jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiral Matalia <Hiral.Mata...@bjss.com>
Subject trying to setup resource-based ACLs
Date Tue, 03 Jun 2014 09:55:05 GMT
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

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