com.holonplatform.auth

## Interface Permission

- All Superinterfaces:
    Serializable

      public interface Permission
      extends Serializable

  Represents a generic permission granted to a principal in authorization context and associated to an `Authentication` object.

  Could be for example a role associated to a user principal.

  Explicit `equals(Object)` and `hashCode()` methods implementation is expected for a proper authorization control behaviour.

  Since:
    5.0.0
  See Also:
    `Authorizer`

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Permission` | `create(String permission)` Create a default Permission implementation, using given `permission` String to represent permission authority.
    `boolean` | `equals(Object permission)`
    `Optional<String>` | `getPermission()` If this permission can be represented as a String retaining a sufficient precision to be relied upon for a access control decisions, this method should return such string.
    `int` | `hashCode()`

- - ### Method Detail

    - #### getPermission

          Optional<String> getPermission()

      If this permission can be represented as a String retaining a sufficient precision to be relied upon for a access control decisions, this method should return such string.
      Returns:
        a representation of the Permission, or empty if this permission cannot be expressed as a String with sufficient precision

    - #### hashCode

          int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          boolean equals(Object permission)

      Overrides:
        `equals` in class `Object`

    - #### create

          static Permission create(String permission)

      Create a default Permission implementation, using given `permission` String to represent permission authority.
      Parameters:
        `permission` - String representation of the permission. Must be not `null`.
      Returns:
        Permission instance

Copyright © 2019 The Holon Platform. All rights reserved.