ewesten commented on issue #2405:
URL: https://github.com/apache/shiro/issues/2405#issuecomment-3603083054

   Hello,
   
   thanks for the reply, but I am not getting it yet (sorry if I am slow). 
   
   Here is my basic coding (attempting to adopt the proposal above).
   However it is not working in Shiro 2.0.6. (In 2.0.3 it was working even 
without `bind()` and `associateWith`. )
   
   ```
   Runnable task = () -> {
     try {
       ThreadContext.bind(SecurityUtils.getSecurityManager());
       // my code with access control check based on principal
     } finally {
       ThreadContext.remove();
     }
   };
   
   Subject subject = SecurityUtils.getSubject();
   subject.associateWith(task);
   Thread t = new Thread(task, "myworker");
   t.start();
   ```
   
   Essentially it is not clear to me how to obtain / propagate  the correct 
security manager in the child thread.
   
   Regards, Eric


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to