jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francisco Carriedo Scher <fcarrie...@gmail.com>
Subject Setting permissions
Date Mon, 12 Sep 2011 15:55:13 GMT
Hi there,

i am trying to get working resource-based ACLs with the following code:

AccessControlManager acm = session.getAccessControlManager();
ACLProvider aclProvider = new ACLProvider();

Privilege[] privilegios = new Privilege[3];

privilegios[0] = acm.privilegeFromName(Privilege.JCR_READ);
privilegios[1] = acm.privilegeFromName(Privilege.JCR_ADD_CHILD_NODES);
privilegios[2] = acm.privilegeFromName(Privilege.JCR_REMOVE_CHILD_NODES);

AccessControlPolicy policy = new MyACLTemplate(actualNode.getPath(),
*acm.setPolicy(actualNode.getPath(), policy);*


but when setPolicy is invoked (bold above) i reach the following code which
doesn't bind the policy to the path and throws an exception:

public void setPolicy(String absPath, AccessControlPolicy policy) throws
PathNotFoundException, AccessControlException, AccessDeniedException,
RepositoryException {
checkPermission(absPath, Permission.MODIFY_AC);

throw new AccessControlException("AccessControlPolicy " + policy + " cannot
be applied.");

I observed that setPolicy method is inherited from
AbstractAccessControlManager, how should i proceed to bind the policy to the
node??? Extend AbstractAccessControlManager with a custom made class???

Thanks for your attention, any orientation will help.

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