Jack Murdoch
Jack Murdoch

Reputation: 2894

Routing based on logged in user type

Not sure if I'm going about this the "right" way.

In my application, I have recently had the requirement added for a second "type" of user. This means realistically I will need to route this user to a different controller than the primary type.

As a more concrete example:

The primary user of the application will be staff members. They will need to see company wide information.

Now, clients of the company will need to be able to log into the application, and see information specific to their needs (and no more).

Furthermore, there are likely to be more types of user in the future.

What is the "correct" way of designing/implementing this?

Upvotes: 0

Views: 58

Answers (1)

Dani Sancas
Dani Sancas

Reputation: 1375

I think that, if you control the users role in the TWIG templates and showing them the only links that they could access (and, of course, protecting the routes with firewalls in the security.yml) may work.

Upvotes: 1

Related Questions