Search in sources :

Example 6 with SimpleNodePermissionEntry

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

the class AbstractPermissionsDaoComponentImpl method getPermissions.

public NodePermissionEntry getPermissions(NodeRef nodeRef) {
    // Create the object if it is not found.
    // Null objects are not cached in hibernate
    // If the object does not exist it will repeatedly query to check its
    // non existence.
    NodePermissionEntry npe = null;
    Acl acl = null;
    try {
        acl = getAccessControlList(nodeRef);
    } catch (InvalidNodeRefException e) {
    // Do nothing.
    }
    if (acl == null) {
        // there isn't an access control list for the node - spoof a null one
        SimpleNodePermissionEntry snpe = new SimpleNodePermissionEntry(nodeRef, true, Collections.<SimplePermissionEntry>emptyList());
        npe = snpe;
    } else {
        npe = createSimpleNodePermissionEntry(nodeRef);
    }
    // done
    if (logger.isDebugEnabled()) {
        logger.debug("Got NodePermissionEntry for node: \n" + "   node: " + nodeRef + "\n" + "   acl: " + npe);
    }
    return npe;
}
Also used : SimpleNodePermissionEntry(org.alfresco.repo.security.permissions.impl.SimpleNodePermissionEntry) InvalidNodeRefException(org.alfresco.service.cmr.repository.InvalidNodeRefException) SimpleNodePermissionEntry(org.alfresco.repo.security.permissions.impl.SimpleNodePermissionEntry) NodePermissionEntry(org.alfresco.repo.security.permissions.NodePermissionEntry)

Aggregations

SimpleNodePermissionEntry (org.alfresco.repo.security.permissions.impl.SimpleNodePermissionEntry)6 NodePermissionEntry (org.alfresco.repo.security.permissions.NodePermissionEntry)4 SimplePermissionEntry (org.alfresco.repo.security.permissions.impl.SimplePermissionEntry)3 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)2 AccessControlEntry (org.alfresco.repo.security.permissions.AccessControlEntry)2 AccessControlList (org.alfresco.repo.security.permissions.AccessControlList)2 PermissionEntry (org.alfresco.repo.security.permissions.PermissionEntry)2 PermissionReference (org.alfresco.repo.security.permissions.PermissionReference)2 SimpleAccessControlEntry (org.alfresco.repo.security.permissions.SimpleAccessControlEntry)2 InvalidNodeRefException (org.alfresco.service.cmr.repository.InvalidNodeRefException)2 NodeRef (org.alfresco.service.cmr.repository.NodeRef)2 HashSet (java.util.HashSet)1 PermissionServiceTrait (org.alfresco.repo.security.permissions.impl.traitextender.PermissionServiceTrait)1 Reference (org.alfresco.repo.virtual.ref.Reference)1 QName (org.alfresco.service.namespace.QName)1