Class RunAsUserAspect
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.service.analysis.annotations.RunAsUserAspect
-
@Order(999) public class RunAsUserAspect extends java.lang.Object
Aspect to update the Authentication object in the SecurityContext to be the user specified in the annotation using SpEL.- See Also:
RunAsUser
-
-
Field Summary
Fields Modifier and Type Field Description static int
RUN_AS_USER_ORDER
-
Constructor Summary
Constructors Constructor Description RunAsUserAspect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
setSecurityContextFromAnalysisSubmission(org.aspectj.lang.ProceedingJoinPoint jp, RunAsUser userAnnotation)
Advice around a method annotated withRunAsUser
.
-
-
-
Field Detail
-
RUN_AS_USER_ORDER
public static final int RUN_AS_USER_ORDER
- See Also:
- Constant Field Values
-
-
Method Detail
-
setSecurityContextFromAnalysisSubmission
public java.lang.Object setSecurityContextFromAnalysisSubmission(org.aspectj.lang.ProceedingJoinPoint jp, RunAsUser userAnnotation) throws java.lang.Throwable
Advice around a method annotated withRunAsUser
. This method will set theUser
specified in theRunAsUser.value()
using SpEL in the security context before the method is run, then reset the original user after the method completes.- Parameters:
jp
-ProceedingJoinPoint
for the called methoduserAnnotation
-RunAsUser
annotation specifying the user- Returns:
- Return value of the method called
- Throws:
java.lang.Throwable
- if the method throws an exception
-
-