0
votes

i've been using symfony 1.4 to build a project that i didn't quite think through all the way. the site has four user types: A, B, C, and users who aren't authenticated. i need for each user type to have their own set of routing and actions. when a user of type A visits mysite.com/ he will see something different than users who are B's, C's, and not logged in. A users might also have these routes available to them: mysite.com/users, mysite.com/groups, etc., whereas B's, C's, and non-authenticated users might not. basically, sometimes users might share some routes (like /), and sometimes they won't.

symfony unfortunately loads the routing before it hits the user filter, and as far as i can tell there's no easy way to repopulate the routing on the fly and redispatch. using switchTo also seems horribad because i'd essentially be loading the application twice for each request.

basically i need the framework to look at the users type and load the appropriate routing. any solutions involving symfony are desperately welcome! D:

1

1 Answers

0
votes

Think about your application design. URLs are identifiers to Objects. It's not a good design to use the same URL for different things.

Maybe if the type of Users are really different you can also consider to create different apps for the interfaces. Then you can also create different session cookies.

URLS can then be
/ the frontpage
/groups the group page for all normal users
/admin/groups administration interface for groups