I have always loved the way Yii allows you to easily assign who can perform what action using the accessRules() method in the controller. However I always assumed that you could replace assigning guests ‘*’, logged in users ‘@’ and ‘admin’ with roles that are defined with RBAC.
I have learnt that this is not the case and instead we need to run if statements like the following in the action method:
if(Yii::app()->user->checkAccess('createPost'))
Can someone shed some light on why it is not done this way. I’m sure there’s good reasons but knowing why would help me move on from wanting it to work this way.