org.keycloak.authorization.policy.evaluation

## Class DefaultEvaluation

- java.lang.Object
- - org.keycloak.authorization.policy.evaluation.DefaultEvaluation

- All Implemented Interfaces:
    Evaluation

      public class DefaultEvaluation
      extends Object
      implements Evaluation

  Author:
    Pedro Igor

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultEvaluation(ResourcePermission permission, EvaluationContext executionContext, Decision decision, AuthorizationProvider authorizationProvider)`
    `DefaultEvaluation(ResourcePermission permission, EvaluationContext executionContext, Policy parentPolicy, Decision decision, AuthorizationProvider authorizationProvider, Map<Policy,Map<Object,Decision.Effect>> decisionCache)`
    `DefaultEvaluation(ResourcePermission permission, EvaluationContext executionContext, Policy parentPolicy, Policy policy, Decision decision, AuthorizationProvider authorizationProvider, Map<Policy,Map<Object,Decision.Effect>> decisionCache)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `deny()` Denies the requested permission.
    `void` | `denyIfNoEffect()` Denies the requested permission if a decision was not made yet.
    `AuthorizationProvider` | `getAuthorizationProvider()`
    `EvaluationContext` | `getContext()` Returns the `EvaluationContext`.
    `Map<Policy,Map<Object,Decision.Effect>>` | `getDecisionCache()`
    `Decision.Effect` | `getEffect()`
    `Policy` | `getParentPolicy()`
    `ResourcePermission` | `getPermission()` Returns the `ResourcePermission` to be evaluated.
    `Policy` | `getPolicy()` Returns the `Policy`.
    `Realm` | `getRealm()` Returns a `Realm` that can be used by policies to query information.
    `void` | `grant()` Grants the requested permission to the caller.
    `void` | `setEffect(Decision.Effect effect)`
    `void` | `setPolicy(Policy policy)`

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

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

- - ### Constructor Detail

    - #### DefaultEvaluation

          public DefaultEvaluation(ResourcePermission permission,
                                   EvaluationContext executionContext,
                                   Policy parentPolicy,
                                   Decision decision,
                                   AuthorizationProvider authorizationProvider,
                                   Map<Policy,Map<Object,Decision.Effect>> decisionCache)

    - #### DefaultEvaluation

          public DefaultEvaluation(ResourcePermission permission,
                                   EvaluationContext executionContext,
                                   Decision decision,
                                   AuthorizationProvider authorizationProvider)

    - #### DefaultEvaluation

          public DefaultEvaluation(ResourcePermission permission,
                                   EvaluationContext executionContext,
                                   Policy parentPolicy,
                                   Policy policy,
                                   Decision decision,
                                   AuthorizationProvider authorizationProvider,
                                   Map<Policy,Map<Object,Decision.Effect>> decisionCache)

  - ### Method Detail

    - #### getPermission

          public ResourcePermission getPermission()

      Description copied from interface: `Evaluation`
      Returns the `ResourcePermission` to be evaluated.
      Specified by:
        `getPermission` in interface `Evaluation`
      Returns:
        the permission to be evaluated

    - #### getContext

          public EvaluationContext getContext()

      Description copied from interface: `Evaluation`
      Returns the `EvaluationContext`. Which provides access to the whole evaluation runtime context.
      Specified by:
        `getContext` in interface `Evaluation`
      Returns:
        the evaluation context

    - #### grant

          public void grant()

      Description copied from interface: `Evaluation`
      Grants the requested permission to the caller.
      Specified by:
        `grant` in interface `Evaluation`

    - #### deny

          public void deny()

      Description copied from interface: `Evaluation`
      Denies the requested permission.
      Specified by:
        `deny` in interface `Evaluation`

    - #### getPolicy

          public Policy getPolicy()

      Description copied from interface: `Evaluation`
      Returns the `Policy`. being evaluated.
      Specified by:
        `getPolicy` in interface `Evaluation`
      Returns:
        the evaluation context

    - #### getRealm

          public Realm getRealm()

      Description copied from interface: `Evaluation`
      Returns a `Realm` that can be used by policies to query information.
      Specified by:
        `getRealm` in interface `Evaluation`
      Returns:
        a `Realm` instance

    - #### getAuthorizationProvider

          public AuthorizationProvider getAuthorizationProvider()

      Specified by:
        `getAuthorizationProvider` in interface `Evaluation`

    - #### getParentPolicy

          public Policy getParentPolicy()

    - #### getEffect

          public Decision.Effect getEffect()

    - #### getDecisionCache

          public Map<Policy,Map<Object,Decision.Effect>> getDecisionCache()

    - #### denyIfNoEffect

          public void denyIfNoEffect()

      Description copied from interface: `Evaluation`
      Denies the requested permission if a decision was not made yet.
      Specified by:
        `denyIfNoEffect` in interface `Evaluation`

    - #### setPolicy

          public void setPolicy(Policy policy)

    - #### setEffect

          public void setEffect(Decision.Effect effect)

Copyright © 2021 JBoss by Red Hat. All rights reserved.