Class GrantedAuthorities

java.lang.Object
com.gigaspaces.security.authorities.GrantedAuthorities
All Implemented Interfaces:
Serializable

public final class GrantedAuthorities extends Object implements Serializable
Encapsulates the authorities granted to a specific user, to ease access control and authorization decisions.
Since:
7.0.1
Author:
Moran Avigdor
See Also:
  • Constructor Details

    • GrantedAuthorities

      public GrantedAuthorities(Authority[] authorities)
  • Method Details

    • isGranted

      public boolean isGranted(Privilege privilege)
      Evaluates to true if has been granted the required privilege, disregarding any classname filters of a SpaceAuthority.
      Parameters:
      privilege - the required privilege.
      Returns:
      true if the required privilege was granted; false otherwise.
    • isGranted

      public boolean isGranted(Privilege privilege, Object object)
      Evaluates to true if has been granted the required privileges to access the specified object. The data object parameter is used against one of the SpaceAuthority.Filters; if null will return false. Currently all implemented filters accept an object of type String.
      Parameters:
      privilege - the required privilege
      object - the data object (can be null)
      Returns:
      true if the required privilege to access the object was granted; false otherwise.
    • isUserInRole

      public boolean isUserInRole(String role)
      Returns a boolean indicating whether the authenticated user is included in the specified logical "role".
      Parameters:
      role - a String specifying the name of the role
      Returns:
      a boolean indicating whether the user making this request belongs to a given role; false if the user has not been authenticated
    • getAuthorities

      public Authority[] getAuthorities()
      Returns:
      all populated authorities belonging to this authenticated user
      Since:
      15.5
    • toString

      public String toString()
      Overrides:
      toString in class Object