use of org.alfresco.repo.security.permissions.AccessControlListProperties in project alfresco-repository by Alfresco.
the class AclDaoComponentTest method testCreateDefining.
public void testCreateDefining() {
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);
}
use of org.alfresco.repo.security.permissions.AccessControlListProperties in project alfresco-repository by Alfresco.
the class AclDaoComponentTest method testGlobal.
public void testGlobal() {
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
properties.setAclType(ACLType.GLOBAL);
properties.setVersioned(false);
AccessControlListProperties aclProps = aclDaoComponent.createAccessControlList(properties);
Long id = aclProps.getId();
assertEquals(aclProps.getAclType(), ACLType.GLOBAL);
assertEquals(aclProps.getAclVersion(), Long.valueOf(1l));
assertEquals(aclProps.getInherits(), Boolean.TRUE);
assertEquals(aclDaoComponent.getAccessControlListProperties(aclProps.getId()), aclProps);
assertEquals(aclDaoComponent.getInheritedAccessControlList(id), id);
}
use of org.alfresco.repo.security.permissions.AccessControlListProperties in project alfresco-repository by Alfresco.
the class AclDaoComponentTest method testCreateOld.
public void testCreateOld() {
SimpleAccessControlListProperties properties = new SimpleAccessControlListProperties();
properties.setAclType(ACLType.OLD);
properties.setVersioned(false);
AccessControlListProperties aclProps = aclDaoComponent.createAccessControlList(properties);
assertEquals(aclProps.getAclType(), ACLType.OLD);
assertEquals(aclProps.getAclVersion(), Long.valueOf(1l));
assertEquals(aclProps.getInherits(), Boolean.TRUE);
assertEquals(aclDaoComponent.getAccessControlListProperties(aclProps.getId()), aclProps);
assertEquals(aclDaoComponent.getInheritedAccessControlList(aclProps.getId()), null);
}
use of org.alfresco.repo.security.permissions.AccessControlListProperties 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