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);
}
Aggregations