public class UserSecurityAdvice extends Object implements org.springframework.aop.MethodBeforeAdvice, org.springframework.aop.AfterReturningAdvice
Modifier and Type | Field and Description |
---|---|
static String |
ACCESS_DENIED
Default "Access Denied" error message (not i18n-ized).
|
Constructor and Description |
---|
UserSecurityAdvice() |
Modifier and Type | Method and Description |
---|---|
void |
afterReturning(Object returnValue,
Method method,
Object[] args,
Object target)
After returning, grab the user, check if they've been modified and reset
the SecurityContext if they have.
|
void |
before(Method method,
Object[] args,
Object target)
Method to enforce security and only allow administrators to modify users.
|
public static final String ACCESS_DENIED
public void before(Method method, Object[] args, Object target) throws Throwable
before
in interface org.springframework.aop.MethodBeforeAdvice
method
- the name of the method executedargs
- the arguments to the methodtarget
- the target classThrowable
- thrown when args[0] is null or not a User objectpublic void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable
afterReturning
in interface org.springframework.aop.AfterReturningAdvice
returnValue
- the user objectmethod
- the name of the method executedargs
- the arguments to the methodtarget
- the target classThrowable
- thrown when args[0] is null or not a User objectCopyright © 2015. All rights reserved.