-
Dec 7th, 2012, 05:57 AM
#1
How to insert Roles from database as GrantedAuthoritySid in MutableAcl?
I have a mutableacl service as follows:-
private MutableAclService mutableAclService;
public void setMutableAclService(MutableAclService mutableAclService) {
this.mutableAclService = mutableAclService;
}
And i have added the ObjectIdentity into it.
ObjectIdentity oid =new ObjectIdentityImpl(Message.class, message.getId());
MutableAcl acl = mutableAclService.createAcl(oid);
And set permission as follows:-
acl.insertAce(0, BasePermission.ADMINISTRATION,new PrincipalSid(request.getRemoteUser()), true);
acl.insertAce(1, BasePermission.DELETE,new GrantedAuthoritySid("ROLE_ADMIN"), true);
acl.insertAce(2, BasePermission.READ,new GrantedAuthoritySid("ROLE_USER"), true);
I need to know how to make the roles(ie "ROLE_ADMIN","ROLE_USER") dynamic from database.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules