Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8973033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:21:31+00:00 2026-06-15T18:21:31+00:00

EXPLANATION Allowing user to switch to any other user is easy in Symfony2. My

  • 0

EXPLANATION

Allowing user to switch to any other user is easy in Symfony2. My question is, how to allow certain user to switch only to certain other users? I’m using FOSUserBundle as my users provider.

EXAMPLE

There is 5 users, UserA, UserB, UserC, UserD, UserE, but only 3 of them are linked together.

UserA can switch to UserB and UserC

UserB can switch to UserA and UserC

UserC can switch to UserA and UserB

Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:21:32+00:00Added an answer on June 15, 2026 at 6:21 pm

    You could possibly implement this type of thing by overriding the default SwitchUserListener.

    The parameter you would override is: security.authentication.switchuser_listener.class

    For example, in parameters.yml:

    parameters:
      security.authentication.switchuser_listener.class: My\Project\Security\Listener\SwitchUserListener
    

    Where, in your custom listener class, you’d implement Symfony\Component\Security\Http\Firewall\ListenerInterface and use the existing Symfony\Component\Security\Http\Firewall\SwitchUserListener class as a basis for your custom implementation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Explanation: I'm using ember-data for a project of mine and I have a question
Question How can I animate and form rows together? Explanation One 'for loop' is
Explanation: I have a grid with a checkbox column where users can check records
Is there any explanation why find() algorithm doesn't work for maps and one have
Is there any explanation of this strange behavior of defined constant? I have 1
big explanation (better safe...), question in bold if you don't want to read it
just need a little explanation please. I am referencing question here about listening to
Some explanation: there are several machines(hosts) that need to be notified about any changes
Is there any good explanation of how to use MySQL's foreign key construct? I
Is there any brief explanation for IP security? And Why do we use it?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.