Hello,
I don’t really get how the RBAC bizrules are working.
I would like to create an operation with the following bizrule :
-
Controller (to access an action) : if the current user (Yii::app()->user->id) is the same as the user that is being deleted —> return false
-
Views (to display a delete button) : if the current user (Yii::app()->user->id) is the same as the one in the row (CGriedView) --> return false
And so in the view I would use :
Yii::app()->user->checkAccess('deleteUser')
and in the controller the accessControl filter :
array('allow',
'actions'=>array('delete'),
'roles'=>array('deleteUser'),
),
Can someone help me ?
Thanks,
Maxime.