Results 1 to 3 of 3

Thread: Exposing current user in @Publisher/@Payload context

  1. #1
    Join Date
    Dec 2008
    Posts
    5

    Default Exposing current user in @Publisher/@Payload context

    Hey there,

    I'm just starting out with spring integration and would like to use the AOP stuff to do some basic auditing.

    Is there a way to easily expose the user set by spring-security to be available in SpEL expressions for payloads? Or would I have to wire up my own MethodInterceptor?

    Thanks

  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    SpEL does provide a general mechanism for invoking static methods using the 'T' operator (where T stands for 'Type'). For example:
    Code:
    T(org.springframework.security.core.context.SecurityContextHolder).getContext()

  3. #3
    Join Date
    Dec 2008
    Posts
    5

    Default

    Thanks for the answer.

    I really should get more familiar with SpEL.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •