com.holonplatform.spring.security.internal

## Class SpringSecurityPermission

- java.lang.Object
- - com.holonplatform.spring.security.internal.SpringSecurityPermission

- All Implemented Interfaces:
    Permission, Serializable

      public class SpringSecurityPermission
      extends Object
      implements Permission

  `Permission` representation using a Spring Security `GrantedAuthority`.

  The `GrantedAuthority.getAuthority()` value is used as `String` permission representation.

  Since:
    5.1.0
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SpringSecurityPermission(org.springframework.security.core.GrantedAuthority authority)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `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()`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.auth.Permission

      `create`

- - ### Constructor Detail

    - #### SpringSecurityPermission

          public SpringSecurityPermission(org.springframework.security.core.GrantedAuthority authority)

      Constructor.
      Parameters:
        `authority` - Spring Security authority (not null)

  - ### Method Detail

    - #### getPermission

          public Optional<String> getPermission()

      Description copied from interface: `Permission`
      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.
      Specified by:
        `getPermission` in interface `Permission`
      Returns:
        a representation of the Permission, or empty if this permission cannot be expressed as a String with sufficient precision

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### hashCode

          public int hashCode()

      Specified by:
        `hashCode` in interface `Permission`
      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Specified by:
        `equals` in interface `Permission`
      Overrides:
        `equals` in class `Object`

Copyright © 2019 The Holon Platform. All rights reserved.