Sunday, 15 August 2010

Spring Security - How to know if Sid is a principal or authority -


I would like to know whether a sid ("currentSid") recovered with permission in the acl_entry table is of a principal or authorization.

 for  (int j = 0; j & lt; acl.getEntries (). Size (); j ++) {string currentPermissionPattern = Acl .getEntries () find (j) .getPermission () getPattern () .. String currentSid = acl.getEntries (). Get (j) .getSid (). ToString (); }   

I am currently storing the currentSID as a string. Let's say I store it as a syd, how do I know if it is related to any user or role?

You can do this:
  if (acl.getEntries () .get (j) .getSid () for example valid authority) {valid authorization sid = (valid authorization) acl.getEntries (). (J) .getSid (); // This role is) and (principal seed sid = (Principalscid) acl.getEntries (). Get (j) .getSid (); // it is user}    

No comments:

Post a Comment