Class 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
    • Constructor Detail

      • RunAsUserAspect

        public RunAsUserAspect()
    • Method Detail

      • setSecurityContextFromAnalysisSubmission

        public java.lang.Object setSecurityContextFromAnalysisSubmission​(org.aspectj.lang.ProceedingJoinPoint jp,
                                                                         RunAsUser userAnnotation)
                                                                  throws java.lang.Throwable
        Advice around a method annotated with RunAsUser. This method will set the User specified in the RunAsUser.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 method
        userAnnotation - RunAsUser annotation specifying the user
        Returns:
        Return value of the method called
        Throws:
        java.lang.Throwable - if the method throws an exception