Class Grant

java.lang.Object
io.helidon.security.Grant
All Implemented Interfaces:
AbacSupport, Principal
Direct Known Subclasses:
Role

public class Grant extends Object implements AbacSupport, Principal
A concept representing anything that can be granted to a subject. This may be:
  • role
  • scope
  • permission
  • anything else grantable, including additional principals
  • Constructor Details

    • Grant

      protected Grant(Grant.Builder<?> builder)
      Create an instance based on a builder.
      Parameters:
      builder - builder instance
  • Method Details

    • builder

      public static Grant.Builder<?> builder()
      Creates a fluent API builder to build new instances of this class.
      Returns:
      builder instance
    • abacAttributeRaw

      public Object abacAttributeRaw(String key)
      Description copied from interface: AbacSupport
      Return the actual property value or null if not present. This is the only method that needs to be implemented.
      Specified by:
      abacAttributeRaw in interface AbacSupport
      Parameters:
      key - key (name) of the property
      Returns:
      value of the property or null
    • abacAttributeNames

      public Collection<String> abacAttributeNames()
      Description copied from interface: AbacSupport
      A collection of all property names in this container.
      Specified by:
      abacAttributeNames in interface AbacSupport
      Returns:
      collection of keys
    • type

      public String type()
      Type of this grant. Known types:
      • "role" - represents a role grant, also a dedicated class is created for this type: Role
      • "scope" - represents a OAuth2 scope grant
      Returns:
      type of the grant
    • getName

      public String getName()
      Specified by:
      getName in interface Principal
    • toString

      public String toString()
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object
    • origin

      public String origin()
      Origin of this grant - this may be an arbitrary string, URI, component creating it etc.
      Returns:
      origin of this grant
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class Object