Search in sources :

Example 21 with SimpleAccessControlListProperties

use of org.alfresco.repo.security.permissions.SimpleAccessControlListProperties in project alfresco-repository by Alfresco.

the class AclDaoComponentTest method testCreateShared.

public void testCreateShared() {
    SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
    properties.setAclType(ACLType.DEFINING);
    properties.setVersioned(true);
    AccessControlListProperties aclProps = aclDaoComponent.createAccessControlList(properties);
    assertEquals(aclProps.getAclType(), ACLType.DEFINING);
    assertEquals(aclProps.getAclVersion(), Long.valueOf(1l));
    assertEquals(aclProps.getInherits(), Boolean.TRUE);
    assertEquals(aclDaoComponent.getAccessControlListProperties(aclProps.getId()), aclProps);
    Long shared = aclDaoComponent.getInheritedAccessControlList(aclProps.getId());
    AccessControlListProperties sharedProps = aclDaoComponent.getAccessControlListProperties(shared);
    assertEquals(sharedProps.getAclType(), ACLType.SHARED);
    assertEquals(sharedProps.getAclVersion(), Long.valueOf(1l));
    assertEquals(sharedProps.getInherits(), Boolean.TRUE);
    assertEquals(aclDaoComponent.getInheritedAccessControlList(aclProps.getId()), shared);
}
Also used : AccessControlListProperties(org.alfresco.repo.security.permissions.AccessControlListProperties) SimpleAccessControlListProperties(org.alfresco.repo.security.permissions.SimpleAccessControlListProperties) SimpleAccessControlListProperties(org.alfresco.repo.security.permissions.SimpleAccessControlListProperties)

Aggregations

SimpleAccessControlListProperties (org.alfresco.repo.security.permissions.SimpleAccessControlListProperties)21 AccessControlListProperties (org.alfresco.repo.security.permissions.AccessControlListProperties)9 SimpleAccessControlEntry (org.alfresco.repo.security.permissions.SimpleAccessControlEntry)9 AclChange (org.alfresco.repo.security.permissions.impl.AclChange)4 ArrayList (java.util.ArrayList)3 AccessControlList (org.alfresco.repo.security.permissions.AccessControlList)3 HashSet (java.util.HashSet)2 NodeIdAndAclId (org.alfresco.repo.domain.node.NodeIdAndAclId)1 AccessControlEntry (org.alfresco.repo.security.permissions.AccessControlEntry)1 SimpleAccessControlList (org.alfresco.repo.security.permissions.SimpleAccessControlList)1