Hi Clay

Thanks a lot for your response. I have been through your code and have
found that you have also been using getApplicablePolicies(path) and
getPolicies(path) function to get AccessControlList (ACL) object, however
both of these function have not been returning any ACL policies for me. In
words my node does not contain any modifiable ACL. Can you tell me why is
that. What will I have to do, so that the node should also have modifiable
ACL.

Kind regards,
Atif

On Mon, Aug 24, 2015 at 7:01 PM, Clay Ferguson <[email protected]> wrote:

> Hello Atif,
>
> You should check out my open source project:
> https://github.com/Clay-Ferguson/meta64
>
> Download the zip and search for the words 'privilege' and/or AccessControl,
> etc.
>
> The AclService.java class has ability to do basic listing of privileges for
> a node, and adding or removing privileges from a node, and might help you
> some. Good luck.
>
> Best regards,
> Clay Ferguson
> [email protected]
>
>
> On Mon, Aug 24, 2015 at 12:07 PM, Atif Manzoor <[email protected]>
> wrote:
>
> > I am new to Jackrabbit and after going through the first hops and little
> > bit of documentation, I was trying to configure Access Control for the
> > repository nodes. I was extending ThirdHop tutorial for that purpose and
> > was following access control wiki
> > http://wiki.apache.org/jackrabbit/AccessControl and had the following
> > code.
> >
> > Session session = repository.login(new SimpleCredentials("username",
> > "password"
> > .toCharArray()));
> > Node node = session.getRootNode();
> > String path = node.getPath();
> > AccessControlManager acm = session.getAccessControlManager();
> >
> > Privilege[] privileges = new Privilege[] { acm
> > .privilegeFromName(Privilege.JCR_ALL) };
> > AccessControlList acl;
> > try {
> > acl = (AccessControlList) acm.getApplicablePolicies(path)
> > .nextAccessControlPolicy();
> > } catch (NoSuchElementException e) {
> > acl = (AccessControlList) acm.getPolicies(path)[0];
> > }
> > for (AccessControlEntry e : acl.getAccessControlEntries()) {
> > acl.removeAccessControlEntry(e);
> > }
> > acl.addAccessControlEntry(EveryonePrincipal.getInstance(), privileges);
> > acm.setPolicy(path, acl);
> > session.save();
> >
> > My problem is that I could not get AccessControlList with this code. Both
> > functions (getApplicablePolicies and getAllPolicies) don't have any
> > AccessControlList attached with them. Can you tell me where I went
> wrong. I
> > have been using the default security configuration.
> >
> > Thanks
> > Atif
> >
>

Reply via email to