GigaSpaces XAP 9.1 API

com.gigaspaces.security.authorities
Class PopulatedRoleAuthority

java.lang.Object
  extended by com.gigaspaces.security.authorities.RoleAuthority
      extended by com.gigaspaces.security.authorities.PopulatedRoleAuthority
All Implemented Interfaces:
Authority, Serializable

public class PopulatedRoleAuthority
extends RoleAuthority

A role authority which holds all the authorities this role represents.

Commonly, a users' details are stored in one table 'users-table' and its roles are stored in another 'role-table'. The users' authorities of type RoleAuthority are actually keys (by role-name) to the role details.

When authenticating a user, an Authentication object is returned with all the users' details and authorities. To be ignorant of how details are actually kept, the users' details are populated with a flat representation of all the authorities a role represents.

The first option to populate a users' authorities with a role is to just add the authorities a role represents. But, you loose the 'role' representation. If you want to keep it, for example for visibility in tooling, you can return a PopulatedRoleAuthority. Thus, UserDetails.getAuthorities() will include user-specific authorities and PopulatedRoleAuthority.

This is only relevant is you are planning to implement your own SecurityManager. Out default implementation already incorporates this construct.

Since:
7.0.1
Author:
Moran Avigdor
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gigaspaces.security.authorities.RoleAuthority
RoleAuthority.RolePrivilege
 
Constructor Summary
PopulatedRoleAuthority(String role, Authority[] authorities)
          Constructs a role authority with all the authorities this role represents.
 
Method Summary
 
Methods inherited from class com.gigaspaces.security.authorities.RoleAuthority
getAuthority, getRole, toString, valueOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PopulatedRoleAuthority

public PopulatedRoleAuthority(String role,
                              Authority[] authorities)
Constructs a role authority with all the authorities this role represents.

Parameters:
role - role name

GigaSpaces XAP 9.1 API

Copyright © GigaSpaces.