You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Hiral Matalia <Hi...@bjss.com> on 2014/06/03 11:56:20 UTC

trying to setup resource-based ACLs

Hi,

I am quite new to Jackrabbit.
I am trying to set "ALL" Privileges for the user who is creator/owner of the node.
Using Resource based ACL.
I understand that I need to have Principal for that user.
I got below code snippet

JackrabbitSession js = (JackrabbitSession) session;
        PrincipalManager pMgr = js.getPrincipalManager();
        Principal principal = pMgr.getPrincipal(user);

        AccessControlUtils.addAccessControlEntry(session,
                resNode.getPath(),
                principal,
                new String[] { Privilege.JCR_ALL },
                true);
    }

In above user is username , say testUser.
I am getting Principal as null :(
I am not sure what am I missing here, what do I need to do with PrincipalManger to get Principal for particular user who is creator/owner.

Any pointers or help is really appreciated.

Thanks !
Hiral

The information included in this email and any files transmitted with it may contain information that is confidential and it must not be used by, or its contents or attachments copied or disclosed, to persons other than the intended addressee. If you have received this email in error, please notify BJSS. In the absence of written agreement to the contrary BJSS' relevant standard terms of contract for any work to be undertaken will apply. Please carry out virus or such other checks as you consider appropriate in respect of this email. BJSS do not accept responsibility for any adverse effect upon your system or data in relation to this email or any files transmitted with it. BJSS Limited, a company registered in England and Wales (Company Number 2777575), VAT Registration Number 613295452, Registered Office Address, First Floor, Coronet House, Queen Street, Leeds, LS1 2TW

Re: trying to setup resource-based ACLs

Posted by Angela Schreiber <an...@adobe.com>.
hi hiral

does the user exist already?
and if it does is 'user', which is probably the userId the same as the principalName?

kind regards
angela

From: Hiral Matalia <Hi...@bjss.com>>
Reply-To: "dev@jackrabbit.apache.org<ma...@jackrabbit.apache.org>" <de...@jackrabbit.apache.org>>
Date: Tuesday 3 June 2014 11:56
To: "dev@jackrabbit.apache.org<ma...@jackrabbit.apache.org>" <de...@jackrabbit.apache.org>>
Subject: trying to setup resource-based ACLs

Hi,

I am quite new to Jackrabbit.
I am trying to set "ALL" Privileges for the user who is creator/owner of the node.
Using Resource based ACL.
I understand that I need to have Principal for that user.
I got below code snippet

JackrabbitSession js = (JackrabbitSession) session;
        PrincipalManager pMgr = js.getPrincipalManager();
        Principal principal = pMgr.getPrincipal(user);

        AccessControlUtils.addAccessControlEntry(session,
                resNode.getPath(),
                principal,
                new String[] { Privilege.JCR_ALL },
                true);
    }

In above user is username , say testUser.
I am getting Principal as null :(
I am not sure what am I missing here, what do I need to do with PrincipalManger to get Principal for particular user who is creator/owner.

Any pointers or help is really appreciated.

Thanks !
Hiral

The information included in this email and any files transmitted with it may contain information that is confidential and it must not be used by, or its contents or attachments copied or disclosed, to persons other than the intended addressee. If you have received this email in error, please notify BJSS. In the absence of written agreement to the contrary BJSS' relevant standard terms of contract for any work to be undertaken will apply. Please carry out virus or such other checks as you consider appropriate in respect of this email. BJSS do not accept responsibility for any adverse effect upon your system or data in relation to this email or any files transmitted with it. BJSS Limited, a company registered in England and Wales (Company Number 2777575), VAT Registration Number 613295452, Registered Office Address, First Floor, Coronet House, Queen Street, Leeds, LS1 2TW