Interface PermissionEvaluator<S,R>

All Known Implementing Classes:
PermissionEvaluatorImpl

public interface PermissionEvaluator<S,R>
Evaluates or checks permissions.
Author:
avasquez
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isAllowed(R resource, String action)
    Checks if the current subject (according to SubjectResolver) is allowed to perform the specified action on the given resource.
    boolean
    isAllowed(S subject, R resource, String action)
    Checks if the given subject is allowed to perform the specified action on the given resource
  • Method Details

    • isAllowed

      boolean isAllowed(R resource, String action) throws PermissionException
      Checks if the current subject (according to SubjectResolver) is allowed to perform the specified action on the given resource.
      Parameters:
      resource - the resource or ID/IDs of the resource whose permissions should be checked. If null, the global permission should be checked
      action - the action the subject wants to perform (not null)
      Returns:
      true if the subject is allowed to execute the action, false otherwise
      Throws:
      PermissionException
    • isAllowed

      boolean isAllowed(S subject, R resource, String action) throws PermissionException
      Checks if the given subject is allowed to perform the specified action on the given resource
      Parameters:
      subject - the subject (not null)
      resource - the resource or ID/IDs of the resource whose permissions should be checked. If null, the global permission should be checked
      action - the action the subject wants to perform (not null)
      Returns:
      true if the subject is allowed to execute the action, false otherwise
      Throws:
      PermissionException