com.tibbo.aggregate.common.security

## Interface PermissionChecker

- All Known Implementing Classes:
    DefaultPermissionChecker, NullPermissionChecker, ServerPermissionChecker

      public interface PermissionChecker

  The `PermissionChecker` is responsible for granting/denying access of various callers to different contexts.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `canActivate(Permissions has, Permissions need, 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 perms, 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`.
    `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.
    `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` | `isValid(java.lang.String permissionLevel)` Returns true if permission level `permissionLevel` is supported by the checker.

- - ### Method Detail

    - #### getPermissionLevels

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

      Returns a map of all permission levels supported by the checker. Each level is defined by a name string and description string.

    - #### getRolePermissionLevels

          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. Each level is defined by a name and a description.

    - #### isValid

          boolean isValid(java.lang.String permissionLevel)

      Returns true if permission level `permissionLevel` is supported by the checker.

    - #### has

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

      Returns true if `caller` is allowed to access an entity those permissions are `requiredPermissions`.

    - #### getLevel

          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.

    - #### canSee

          boolean canSee(Permissions perms,
                         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`.

    - #### canActivate

          java.lang.String canActivate(Permissions has,
                                       Permissions need,
                                       ContextManager cm)

      Checks whether the calling party (those permissions are identified by `has`) can set permissions of some other party to `need`.