0

How can i change the home url depending on the role of the user that is logged in?

I mean, if user has Role Admin make one homeUrl, if it has another role, set a different home url.

I don't just want to redirect the user to the url after loggin, but make the home url different for each user permission.

If user is logged and clicked in nav bar brand, it should go to homeurl of that user.

I think my question is not a duplicate because in my case i don't want to just check if user is guest or not. I want to check the user permission and based on that set the home url.

Rui Sousa
  • 53
  • 9
  • see here how to use event after login https://stackoverflow.com/questions/40081311/how-to-set-separate-homeurl-for-authenticated-users-and-guests-in-yii2 – Muhammad Omer Aslam Feb 23 '18 at 22:00
  • Possible duplicate of [How to set separate homeUrl for authenticated users and guests in yii2](https://stackoverflow.com/questions/40081311/how-to-set-separate-homeurl-for-authenticated-users-and-guests-in-yii2) – Muhammad Omer Aslam Mar 06 '18 at 20:58

1 Answers1

0

Assuming REMOTE_USER is getting set you can always based things off of that. You'll need something (cgi, php, etc.) that can access the variable and direct things based off of it.