Yii roles - Where are they set


In the sitecontroller you have roles with @ and ? symbols, where are they actually set in the app please?

I would have really like to replace them by "guest" and "admin" instead.

Thank you,


Yii 2 understands ? and @. If you want more than that ie, customise your own roles, you will need to do your own authorisation using access filters or maybe RBAC.

For a simple solution see http://www.yiiframework.com/forum/index.php/topic/52882-yii2-tips-tricks/page__view__findpost__p__244102

If you use the advanced template, you can also try Super Simple RBAC. If you are using basic app, you still use it, just skip the parts about backend login. Hope that helps.

@ and ? are not really roles, they identify logged in and not logged in users. Note that this information knows nothing about the actual user, just whether they are logged in or not, this is all you can tell without adding more information to the database in the rbac tables (or a PHP file if you use that instead) with customised roles etc.

Video here if you are interested in the full thing but it is quite meaty!