Can I statically define roles in authManager (in defaultRoles
array in config) and assign them to users so behavior rules define access to actions?
As i have certain roles, I don't want to use auth_assignment
and auth_item
and ...
Assuming I create column in user table for role and every user has one role and roles are define in config file.
In fact I want to build access rules like 'admin' for users who are admin (Where yii says '@' for authenticated user and '?' for guest).
First create your roles somewhere like params then behaviors function can manage authentication easily
myAuth() will check current user role and return true if they role match requested action.