org.appng.api.support

## Class DefaultPermissionProcessor

- java.lang.Object
- - org.appng.api.support.DefaultPermissionProcessor

- All Implemented Interfaces:
    PermissionProcessor
  Direct Known Subclasses:
    DummyPermissionProcessor

      public class DefaultPermissionProcessor
      extends Object
      implements PermissionProcessor

  Default `PermissionProcessor` implementation.
  Author:
    Matthias Müller

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultPermissionProcessor(Subject subject, Site site, Application application)` Creates a new DefaultPermissionProcessor for the given `Subject`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasPermission(String permissionRef)` Checks whether the `Permission` identified by the given `reference` is present.
    `boolean` | `hasPermissions(PermissionOwner permissionOwner)` Checks whether all of the `PermissionOwner`s `Permission`s are present.
    `boolean` | `hasReadPermission(FieldDef fieldDefinition)` Checks whether the `Permission`s to read the value for the given `FieldDef` are present.
    `boolean` | `hasWritePermission(FieldDef fieldDefinition)` Checks whether the `Permission`s to write the value for the given `FieldDef` are present.

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

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

- - ### Constructor Detail

    - #### DefaultPermissionProcessor

          public DefaultPermissionProcessor(Subject subject,
                                            Site site,
                                            Application application)

      Creates a new DefaultPermissionProcessor for the given `Subject`. The current `Subject` uses the given `Application` on the given `Site`.
      Parameters:
        `subject` - the current `Subject` (if any)
        `site` - the `Site` currently used by the `Subject`
        `application` - the `Application` currently used by the `Subject`

  - ### Method Detail

    - #### hasPermissions

          public boolean hasPermissions(PermissionOwner permissionOwner)

      Description copied from interface: `PermissionProcessor`
      Checks whether all of the `PermissionOwner`s `Permission`s are present.
      Specified by:
        `hasPermissions` in interface `PermissionProcessor`
      Parameters:
        `permissionOwner` - the `PermissionOwner`
      Returns:
        `true` if all permissions are present, `false` otherwise

    - #### hasPermission

          public boolean hasPermission(String permissionRef)

      Description copied from interface: `PermissionProcessor`
      Checks whether the `Permission` identified by the given `reference` is present.
      Specified by:
        `hasPermission` in interface `PermissionProcessor`
      Parameters:
        `permissionRef` - the name of the `Permission` to check
      Returns:
        `true` if the permission is present, `false` otherwise
      See Also:
        `Permission.getRef()`

    - #### hasWritePermission

          public boolean hasWritePermission(FieldDef fieldDefinition)

      Description copied from interface: `PermissionProcessor`
      Checks whether the `Permission`s to write the value for the given `FieldDef` are present.
      Specified by:
        `hasWritePermission` in interface `PermissionProcessor`
      Parameters:
        `fieldDefinition` - the `FieldDef` to check the write-permission for
      Returns:
        `true` if the permissions are present and the `FieldDef` isn't readonly, `false` otherwise
      See Also:
        `FieldDef.getReadonly()`, `FieldPermissions`, `FieldPermissionType.WRITE`

    - #### hasReadPermission

          public boolean hasReadPermission(FieldDef fieldDefinition)

      Description copied from interface: `PermissionProcessor`
      Checks whether the `Permission`s to read the value for the given `FieldDef` are present.
      Specified by:
        `hasReadPermission` in interface `PermissionProcessor`
      Parameters:
        `fieldDefinition` - the `FieldDef` to check the read-permission for
      Returns:
        `true` if the permissions are present, `false` otherwise
      See Also:
        `FieldPermissions`, `FieldPermissionType.READ`

Copyright © 2011–2023 aiticon GmbH. All rights reserved.