Class ApiSecurityExpressionRoot

  • All Implemented Interfaces:
    org.springframework.security.access.expression.method.MethodSecurityExpressionOperations, org.springframework.security.access.expression.SecurityExpressionOperations

    public class ApiSecurityExpressionRoot
    extends org.springframework.security.access.expression.SecurityExpressionRoot
    implements org.springframework.security.access.expression.method.MethodSecurityExpressionOperations
    The ApiSecurityExpressionRoot class implements the custom methods, which can be used in conjunction with the @PreAuthorize annotation.
    Author:
    Marcus Portmann
    • Field Summary

      • Fields inherited from class org.springframework.security.access.expression.SecurityExpressionRoot

        admin, authentication, create, delete, denyAll, permitAll, read, write
    • Constructor Summary

      Constructors 
      Constructor Description
      ApiSecurityExpressionRoot​(org.springframework.security.core.Authentication authentication, org.springframework.context.ApplicationContext applicationContext)
      Constructs a new ApiSecurityExpressionRoot.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Object getFilterObject()  
      Object getReturnObject()  
      Object getThis()  
      boolean isSecurityDisabled()
      Returns whether security is disabled.
      boolean isSecurityEnabled()
      Returns whether security is enabled.
      void setFilterObject​(Object filterObject)  
      void setReturnObject​(Object returnObject)  
      • Methods inherited from class org.springframework.security.access.expression.SecurityExpressionRoot

        denyAll, getAuthentication, getPrincipal, hasAnyAuthority, hasAnyRole, hasAuthority, hasPermission, hasPermission, hasRole, isAnonymous, isAuthenticated, isFullyAuthenticated, isRememberMe, permitAll, setDefaultRolePrefix, setPermissionEvaluator, setRoleHierarchy, setTrustResolver
      • Methods inherited from interface org.springframework.security.access.expression.SecurityExpressionOperations

        denyAll, getAuthentication, hasAnyAuthority, hasAnyRole, hasAuthority, hasPermission, hasPermission, hasRole, isAnonymous, isAuthenticated, isFullyAuthenticated, isRememberMe, permitAll
    • Constructor Detail

      • ApiSecurityExpressionRoot

        public ApiSecurityExpressionRoot​(org.springframework.security.core.Authentication authentication,
                                         org.springframework.context.ApplicationContext applicationContext)
        Constructs a new ApiSecurityExpressionRoot.
        Parameters:
        authentication - the authentication
        applicationContext - the Spring application context
    • Method Detail

      • getFilterObject

        public Object getFilterObject()
        Specified by:
        getFilterObject in interface org.springframework.security.access.expression.method.MethodSecurityExpressionOperations
      • getReturnObject

        public Object getReturnObject()
        Specified by:
        getReturnObject in interface org.springframework.security.access.expression.method.MethodSecurityExpressionOperations
      • getThis

        public Object getThis()
        Specified by:
        getThis in interface org.springframework.security.access.expression.method.MethodSecurityExpressionOperations
      • isSecurityDisabled

        public boolean isSecurityDisabled()
        Returns whether security is disabled.
        Returns:
        true if security is disabled or false otherwise
      • isSecurityEnabled

        public boolean isSecurityEnabled()
        Returns whether security is enabled.
        Returns:
        true if security is enabled or false otherwise
      • setFilterObject

        public void setFilterObject​(Object filterObject)
        Specified by:
        setFilterObject in interface org.springframework.security.access.expression.method.MethodSecurityExpressionOperations
      • setReturnObject

        public void setReturnObject​(Object returnObject)
        Specified by:
        setReturnObject in interface org.springframework.security.access.expression.method.MethodSecurityExpressionOperations