com.tibbo.aggregate.common.security

## Class DefaultPermissionChecker

- java.lang.Object
- - com.tibbo.aggregate.common.security.DefaultPermissionChecker

- All Implemented Interfaces:
    PermissionChecker
  Direct Known Subclasses:
    ServerPermissionChecker

      public abstract class DefaultPermissionChecker
      extends java.lang.Object
      implements PermissionChecker

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `NULL_PERMISSIONS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultPermissionChecker()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `canActivate(Permissions existingPermissions, Permissions requiredPermissions, ContextManager cm)` Checks whether the calling party (those permissions are identified by `has`) can set permissions of some other party to `need`.
    `boolean` | `canSee(Permissions permissions, java.lang.String context, ContextManager cm)` Returns true if the calling party (those permissions are identified by `perms`) can see `context` among children of its parent context because it has non-null permissions for one or more direct/nested children of `context`.
    `protected java.util.List<java.lang.String>` | `getAllowedPaths(java.lang.String context, ContextManager cm)`
    `java.lang.String` | `getLevel(Permissions permissions, java.lang.String accessedContext, java.lang.Integer accessedEntityType, java.lang.String accessedEntity, java.lang.String accessedEntityGroup, ContextManager cm)` Returns the effective permission level of the calling party (those permissions are identified by `permissions`) for the entity.
    `LevelInfo` | `getLevelInfo(Permissions existingPermissions, java.lang.String accessedContext, java.lang.Integer accessedEntityType, java.lang.String accessedEntity, java.lang.String accessedEntityGroup, ContextManager cm)`
    `static Permissions` | `getNullPermissions()`
    `java.util.Map<java.lang.Object,java.lang.String>` | `getPermissionLevels()` Returns a map of all permission levels supported by the checker.
    `java.util.Map<java.lang.String,java.lang.String>` | `getRolePermissionLevels(int entityType)` Returns a map of all supported permission levels for the specified entity type.
    `boolean` | `has(CallerController caller, Permissions requiredPermissions, Context accessedContext, EntityDefinition accessedEntityDefinition)` Returns true if `caller` is allowed to access an entity those permissions are `requiredPermissions`.
    `boolean` | `hasNecessaryLevel(java.lang.String existingLevel, java.lang.String requiredLevel)`
    `boolean` | `isValid(java.lang.String level)` Returns true if permission level `permissionLevel` is supported by the checker.
    `protected void` | `setPermissionTypes(PermissionType[] perms)`
    `protected void` | `setRolePermissionTypes(PermissionType[] perms)`

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

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

- - ### Field Detail

    - #### NULL_PERMISSIONS

          public static final java.lang.String NULL_PERMISSIONS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DefaultPermissionChecker

          public DefaultPermissionChecker()

  - ### Method Detail

    - #### setPermissionTypes

          protected void setPermissionTypes(PermissionType[] perms)

    - #### setRolePermissionTypes

          protected void setRolePermissionTypes(PermissionType[] perms)

    - #### getNullPermissions

          public static Permissions getNullPermissions()

    - #### has

          public boolean has(CallerController caller,
                             Permissions requiredPermissions,
                             Context accessedContext,
                             EntityDefinition accessedEntityDefinition)

      Description copied from interface: `PermissionChecker`
      Returns true if `caller` is allowed to access an entity those permissions are `requiredPermissions`.
      Specified by:
        `has` in interface `PermissionChecker`

    - #### getLevel

          public java.lang.String getLevel(Permissions permissions,
                                           java.lang.String accessedContext,
                                           java.lang.Integer accessedEntityType,
                                           java.lang.String accessedEntity,
                                           java.lang.String accessedEntityGroup,
                                           ContextManager cm)
                                    throws java.lang.SecurityException

      Description copied from interface: `PermissionChecker`
      Returns the effective permission level of the calling party (those permissions are identified by `permissions`) for the entity.
      Specified by:
        `getLevel` in interface `PermissionChecker`
      Throws:
        `java.lang.SecurityException`

    - #### getLevelInfo

          public LevelInfo getLevelInfo(Permissions existingPermissions,
                                        java.lang.String accessedContext,
                                        java.lang.Integer accessedEntityType,
                                        java.lang.String accessedEntity,
                                        java.lang.String accessedEntityGroup,
                                        ContextManager cm)
                                 throws java.lang.SecurityException

      Throws:
        `java.lang.SecurityException`

    - #### canSee

          public boolean canSee(Permissions permissions,
                                java.lang.String context,
                                ContextManager cm)

      Description copied from interface: `PermissionChecker`
      Returns true if the calling party (those permissions are identified by `perms`) can see `context` among children of its parent context because it has non-null permissions for one or more direct/nested children of `context`.
      Specified by:
        `canSee` in interface `PermissionChecker`

    - #### hasNecessaryLevel

          public boolean hasNecessaryLevel(java.lang.String existingLevel,
                                           java.lang.String requiredLevel)

    - #### isValid

          public boolean isValid(java.lang.String level)

      Description copied from interface: `PermissionChecker`
      Returns true if permission level `permissionLevel` is supported by the checker.
      Specified by:
        `isValid` in interface `PermissionChecker`

    - #### getPermissionLevels

          public java.util.Map<java.lang.Object,java.lang.String> getPermissionLevels()

      Description copied from interface: `PermissionChecker`
      Returns a map of all permission levels supported by the checker. Each level is defined by a name string and description string.
      Specified by:
        `getPermissionLevels` in interface `PermissionChecker`

    - #### getRolePermissionLevels

          public java.util.Map<java.lang.String,java.lang.String> getRolePermissionLevels(int entityType)

      Description copied from interface: `PermissionChecker`
      Returns a map of all supported permission levels for the specified entity type. Each level is defined by a name and a description.
      Specified by:
        `getRolePermissionLevels` in interface `PermissionChecker`

    - #### canActivate

          public java.lang.String canActivate(Permissions existingPermissions,
                                              Permissions requiredPermissions,
                                              ContextManager cm)

      Description copied from interface: `PermissionChecker`
      Checks whether the calling party (those permissions are identified by `has`) can set permissions of some other party to `need`.
      Specified by:
        `canActivate` in interface `PermissionChecker`

    - #### getAllowedPaths

          protected java.util.List<java.lang.String> getAllowedPaths(java.lang.String context,
                                                                     ContextManager cm)