문제

In Alfresco I've created a folder 'Board' whose contents should only be viewable by members of the group 'board'. I removed the inherited permissions from there and applied a new permission so that members of the group 'board' have the 'collaborator' permission.

I was expecting the following code to return an Acl that I could look at to see how these are constructed, but despite having applied a permission it's showing null. Am I doing something wrong or is this just not supported?

CmisObject object = session.getObjectByPath(path);

Acl acl = object.getAcl();
if (acl != null) {
    // Never reaches here, always returns null
    List<Ace> aces = acl.getAces();
    for (Ace ace : aces) {
        List<String> perms = ace.getPermissions();          
    }
}
도움이 되었습니까?

해결책

You haven't requested the ACL. Try this:

OperationContext oc = session.createOperationContext();
oc.setIncludeAcls(true);

CmisObject object = session.getObjectByPath(path, oc);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top