com.holonplatform.auth.internal

## Class AbstractAuthorizer<P extends Permission>

- java.lang.Object
- - com.holonplatform.auth.internal.AbstractAuthorizer<P>

- Type Parameters:
    `P` - Supported permission type
  All Implemented Interfaces:
    Authorizer<P>
  Direct Known Subclasses:
    DefaultAuthorizer

      public abstract class AbstractAuthorizer<P extends Permission>
      extends Object
      implements Authorizer<P>

  Abstract `Authorizer` implementation
  Since:
    5.0.0
  See Also:
    `DefaultAuthorizer`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractAuthorizer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isPermitted(Authentication authentication, Collection<? extends P> permissions)` Check if given Authentication has all the specified permissions.
    `boolean` | `isPermitted(Authentication authentication, String... permissions)` Check if given Authentication has all specified permission/s, using the `String` permission representation.
    `<T extends P> boolean` | `isPermitted(Authentication authentication, T... permissions)` Check if given Authentication has all the specified permission/s.
    `boolean` | `isPermittedAny(Authentication authentication, Collection<? extends P> permissions)` Check if given Authentication has any of the specified permissions.
    `boolean` | `isPermittedAny(Authentication authentication, String... permissions)` Check if given Authentication has any of the specified permission/s, using the `String` permission representation.
    `<T extends P> boolean` | `isPermittedAny(Authentication authentication, T... permissions)` Check if given Authentication has any of the specified permission/s.

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

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

      `create, getPermissionType`

- - ### Constructor Detail

    - #### AbstractAuthorizer

          public AbstractAuthorizer()

  - ### Method Detail

    - #### isPermitted

          public <T extends P> boolean isPermitted(Authentication authentication,
                                                   T... permissions)

      Description copied from interface: `Authorizer`
      Check if given Authentication has all the specified permission/s.
      Specified by:
        `isPermitted` in interface `Authorizer<P extends Permission>`
      Type Parameters:
        `T` - Permission type
      Parameters:
        `authentication` - The Authentication for which to check the permissions
        `permissions` - The permissions to be checked
      Returns:
        `true` if given Authentication has all the specified permissions

    - #### isPermitted

          public boolean isPermitted(Authentication authentication,
                                     String... permissions)

      Description copied from interface: `Authorizer`
      Check if given Authentication has all specified permission/s, using the `String` permission representation.

      String permission match against Authentication `Permission`s should be performed using the `Permission.getPermission()` method.

      Specified by:
        `isPermitted` in interface `Authorizer<P extends Permission>`
      Parameters:
        `authentication` - The Authentication for which to check the permissions
        `permissions` - The permissions to be checked
      Returns:
        `true` if given Authentication has all the specified permissions

    - #### isPermittedAny

          public <T extends P> boolean isPermittedAny(Authentication authentication,
                                                      T... permissions)

      Description copied from interface: `Authorizer`
      Check if given Authentication has any of the specified permission/s.
      Specified by:
        `isPermittedAny` in interface `Authorizer<P extends Permission>`
      Type Parameters:
        `T` - Permission type
      Parameters:
        `authentication` - The Authentication for which to check the permissions
        `permissions` - The permissions to be checked
      Returns:
        `true` if given Authentication has any of the specified permission

    - #### isPermittedAny

          public boolean isPermittedAny(Authentication authentication,
                                        String... permissions)

      Description copied from interface: `Authorizer`
      Check if given Authentication has any of the specified permission/s, using the `String` permission representation.

      String permission match against Authentication `Permission`s will be performed using `Permission.getPermission()` method.

      Specified by:
        `isPermittedAny` in interface `Authorizer<P extends Permission>`
      Parameters:
        `authentication` - The Authentication for which to check the permissions
        `permissions` - The permissions to be checked
      Returns:
        `true` if given Authentication has any of the specified permission

    - #### isPermitted

          public boolean isPermitted(Authentication authentication,
                                     Collection<? extends P> permissions)

      Description copied from interface: `Authorizer`
      Check if given Authentication has all the specified permissions.
      Specified by:
        `isPermitted` in interface `Authorizer<P extends Permission>`
      Parameters:
        `authentication` - The Authentication for which to check the permissions
        `permissions` - The permissions to be checked
      Returns:
        `true` if given Authentication has all the specified permissions

    - #### isPermittedAny

          public boolean isPermittedAny(Authentication authentication,
                                        Collection<? extends P> permissions)

      Description copied from interface: `Authorizer`
      Check if given Authentication has any of the specified permissions.
      Specified by:
        `isPermittedAny` in interface `Authorizer<P extends Permission>`
      Parameters:
        `authentication` - The Authentication for which to check the permissions
        `permissions` - The permissions to be checked
      Returns:
        `true` if given Authentication has any of the specified permission

Copyright © 2019 The Holon Platform. All rights reserved.