Class DenyAllPermissionEvaluator

java.lang.Object
org.springframework.security.access.expression.DenyAllPermissionEvaluator
All Implemented Interfaces:
org.springframework.aop.framework.AopInfrastructureBean, PermissionEvaluator

public class DenyAllPermissionEvaluator extends Object implements PermissionEvaluator
A null PermissionEvaluator which denies all access. Used by default for situations when permission evaluation should not be required.
Since:
3.0
  • Constructor Details

    • DenyAllPermissionEvaluator

      public DenyAllPermissionEvaluator()
  • Method Details

    • hasPermission

      public boolean hasPermission(Authentication authentication, Object target, Object permission)
      Specified by:
      hasPermission in interface PermissionEvaluator
      Parameters:
      authentication - represents the user in question. Should not be null.
      target - the domain object for which permissions should be checked. May be null in which case implementations should return false, as the null condition can be checked explicitly in the expression.
      permission - a representation of the permission object as supplied by the expression system. Not null.
      Returns:
      false always
    • hasPermission

      public boolean hasPermission(Authentication authentication, Serializable targetId, String targetType, Object permission)
      Description copied from interface: PermissionEvaluator
      Alternative method for evaluating a permission where only the identifier of the target object is available, rather than the target instance itself.
      Specified by:
      hasPermission in interface PermissionEvaluator
      Parameters:
      authentication - represents the user in question. Should not be null.
      targetId - the identifier for the object instance (usually a Long)
      targetType - a String representing the target's type (usually a Java classname). Not null.
      permission - a representation of the permission object as supplied by the expression system. Not null.
      Returns:
      false always