Thanks for the answer, Juanjo. I use
acl.addAccessControlEntry(userPrincipal, supportedPrivileges); in other
places and it works fine. However, I want to add restrictions to nodes
(isAllow=false) . Is this possible with addAccessControlEntry()?

Marc


On Wed, Feb 18, 2009 at 1:44 PM, Juan José Vázquez Delgado <
[email protected]> wrote:

> Hi Marc,
>
> > 1. AccessControlUtil.addEntry() throws "java.lang.NoSuchMethodException:
> >
> org.apache.jackrabbit.core.security.authorization.acl.ACLTemplate.addEntry()"
> > as rootCause. I use
> <Import-Package>*;resolution:=optional</Import-Package>
> > for that bundle and the following code.
> >
> > accessController = AccessControlUtil.getAccessControlManager(session);
> > AccessControlPolicyIterator applicablePolicies =
> > accessController.getApplicablePolicies(pagePath);
> > AccessControlList acl = (AccessControlList)
> > applicablePolicies.nextAccessControlPolicy();
> > Privilege[] supportedPrivileges =
> > accessController.getSupportedPrivileges(pagePath);
> > AccessControlUtil.addEntry(acl, userPrincipal, supportedPrivileges,
> false);
> > accessController.setPolicy(pagePath, acl);
> >
> > What's wrong here?
>
> Please, you can try this instead:
>
> acl.addAccessControlEntry(userPrincipal, supportedPrivileges);
> accessController.setPolicy(path_to_apply_policy, acl);
> session.save();
>
> where session is the opened jcr session over security workspace.
>
> Hope this helps.
>
> Regards,
>
> Juanjo.

Reply via email to