chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick De Graeve <nick.degra...@gmail.com>
Subject Re: ACL problem/question
Date Mon, 10 Dec 2012 08:52:32 GMT
I was able to do it in a vendor-agnostic way using the permission mapping
of the repository info.

RepositoryInfo repositoryInfo = session.getRepositoryInfo();
AclCapabilities aclCapabilities = repositoryInfo.getAclCapabilities();
Map<String, PermissionMapping> permissionMappings =
aclCapabilities.getPermissionMapping();
PermissionMapping permissionMapping =
permissionMappings.get(PermissionMapping.CAN_CHECKOUT_DOCUMENT);
List<String> permissions = permissionMapping.getPermissions();
Ace addAce = session.getObjectFactory().createAce(principal, permissions);
List<Ace> addAces = new LinkedList<Ace>();
addAces.add(addAce);
document.addAcl(addAces, AclPropagation.REPOSITORYDETERMINED);

Thanks for all the help.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message