Class WebSecurityExpressionRoot
- java.lang.Object
-
- org.springframework.security.access.expression.SecurityExpressionRoot
-
- org.springframework.security.web.access.expression.WebSecurityExpressionRoot
-
- All Implemented Interfaces:
org.springframework.security.access.expression.SecurityExpressionOperations
public class WebSecurityExpressionRoot extends org.springframework.security.access.expression.SecurityExpressionRoot
- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description javax.servlet.http.HttpServletRequest
request
Allows direct access to the request object
-
Constructor Summary
Constructors Constructor Description WebSecurityExpressionRoot(java.util.function.Supplier<org.springframework.security.core.Authentication> authentication, javax.servlet.http.HttpServletRequest request)
Creates an instance for the givenSupplier
of theAuthentication
andHttpServletRequest
.WebSecurityExpressionRoot(org.springframework.security.core.Authentication a, FilterInvocation fi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasIpAddress(java.lang.String ipAddress)
Takes a specific IP address or a range using the IP/Netmask (e.g.-
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
-
-
-
-
Constructor Detail
-
WebSecurityExpressionRoot
public WebSecurityExpressionRoot(org.springframework.security.core.Authentication a, FilterInvocation fi)
-
WebSecurityExpressionRoot
public WebSecurityExpressionRoot(java.util.function.Supplier<org.springframework.security.core.Authentication> authentication, javax.servlet.http.HttpServletRequest request)
Creates an instance for the givenSupplier
of theAuthentication
andHttpServletRequest
.- Parameters:
authentication
- theSupplier
of theAuthentication
to userequest
- theHttpServletRequest
to use- Since:
- 5.8
-
-
Method Detail
-
hasIpAddress
public boolean hasIpAddress(java.lang.String ipAddress)
Takes a specific IP address or a range using the IP/Netmask (e.g. 192.168.1.0/24 or 202.24.0.0/14).- Parameters:
ipAddress
- the address or range of addresses from which the request must come.- Returns:
- true if the IP address of the current request is in the required range.
-
-