[symfony-users] Re: Switching roles with moderation

2011-04-28 Thread Vincent Lechemin
Hi, I resolved my problem by adding in attemptSwitchUser line 128 (after the target user ($user) is fetched): if (false === $this-accessDecisionManager-decide($token, $user-getRoles())) { throw new AccessDeniedException(); } But i did not find any other way to add this test to the framework

[symfony-users] Re: Switching roles with moderation

2011-04-28 Thread Vincent Lechemin
I found a solution, maybe it could help someone. It is possible to do that by implementing your own event listener as a service on the event onSecuritySwitchUser. You also need to add the services security.context and security.access.decision_manager as arguments to your service. -- Vincent --