Search in sources :

Example 6 with SimplePermissionReference

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

the class AclCrudDAOTest method testCreateAndDeletePermission.

public void testCreateAndDeletePermission() throws Exception {
    String name = getName() + "-" + System.currentTimeMillis();
    final SimplePermissionReference permRef = SimplePermissionReference.getPermissionReference(QName.createQName("cm:cmobject"), name);
    Permission createdPermEntity = createPermission(permRef);
    assertNotNull(createdPermEntity);
    Permission permEntity = getPermission(permRef);
    assertEquals(createdPermEntity, permEntity);
    deletePermission(permEntity.getId());
    assertNull(getPermission(permRef));
}
Also used : SimplePermissionReference(org.alfresco.repo.security.permissions.impl.SimplePermissionReference)

Aggregations

SimplePermissionReference (org.alfresco.repo.security.permissions.impl.SimplePermissionReference)6 ArrayList (java.util.ArrayList)2 SimpleAccessControlEntry (org.alfresco.repo.security.permissions.SimpleAccessControlEntry)2 QName (org.alfresco.service.namespace.QName)2 Map (java.util.Map)1 Permission (org.alfresco.repo.domain.permissions.Permission)1 AccessControlEntry (org.alfresco.repo.security.permissions.AccessControlEntry)1 AccessControlList (org.alfresco.repo.security.permissions.AccessControlList)1 AccessControlListProperties (org.alfresco.repo.security.permissions.AccessControlListProperties)1 SimpleAccessControlList (org.alfresco.repo.security.permissions.SimpleAccessControlList)1 SimpleAccessControlListProperties (org.alfresco.repo.security.permissions.SimpleAccessControlListProperties)1 AclChange (org.alfresco.repo.security.permissions.impl.AclChange)1 RetryingTransactionCallback (org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback)1 ConcurrencyFailureException (org.springframework.dao.ConcurrencyFailureException)1