Package com.netflix.spinnaker.security
Class AbstractPermissionEvaluator
java.lang.Object
com.netflix.spinnaker.security.AbstractPermissionEvaluator
- All Implemented Interfaces:
org.springframework.aop.framework.AopInfrastructureBean,org.springframework.security.access.PermissionEvaluator
public abstract class AbstractPermissionEvaluator
extends Object
implements org.springframework.security.access.PermissionEvaluator
Base implementation for permission evaluators that support
AccessControlled domain
objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanhasPermission(String username, Serializable targetId, String targetType, Object permission) Alternative method for evaluating a permission where only the identifier of the user and target object is available, rather than the authenticated user and target objects themselves.booleanhasPermission(org.springframework.security.core.Authentication authentication, Serializable targetId, String targetType, Object permission) booleanhasPermission(org.springframework.security.core.Authentication authentication, Object targetDomainObject, Object permission) protected booleanIndicates whether permission evaluation is disabled.
-
Constructor Details
-
AbstractPermissionEvaluator
public AbstractPermissionEvaluator()
-
-
Method Details
-
hasPermission
public boolean hasPermission(org.springframework.security.core.Authentication authentication, Object targetDomainObject, Object permission) - Specified by:
hasPermissionin interfaceorg.springframework.security.access.PermissionEvaluator
-
hasPermission
public boolean hasPermission(org.springframework.security.core.Authentication authentication, Serializable targetId, String targetType, Object permission) - Specified by:
hasPermissionin interfaceorg.springframework.security.access.PermissionEvaluator
-
isDisabled
protected boolean isDisabled()Indicates whether permission evaluation is disabled. When this is true,hasPermissioncalls should return true. This should be overridden to allow for toggling this evaluator at runtime. -
hasPermission
public abstract boolean hasPermission(String username, Serializable targetId, String targetType, Object permission) Alternative method for evaluating a permission where only the identifier of the user and target object is available, rather than the authenticated user and target objects themselves.- Parameters:
username- identifier for user to check permissions fortargetId- identifier of the target resource to check permissionstargetType- the type of the target resource being checkedpermission- the permission being validated- Returns:
- true if the permission is granted
-