how can i get back the actions i defined in my accessrules function
public function accessRules(){
return array(
'allow',
'actions'=>array('create','update' ...),
....
)
}
i need them for dislay reason something like if(in_array('create',$actions)) echo CHtml::link('link to create form') or may be something like if(user->isAutorizedToPerfoem('create')).
thanx in advance
I think this is not possible when you use the accessControl filter. The authorization data is in this case saved directly in the controller, so you technically have to be in the controller to see the accessRules(). And you cannot check access manually, as far as I know. The filter does the work there. You can see your acces rules by calling $this->accessRules, but well you have to be in the controller.
You probably have to use RBAC and save your access rules externally. Read here for more information: Yii Documentation - role based access control
There is also a quite capable Yii extension called Rights, which provides a backend for RBAC.
This might seem like overkill for the moment, but RBAC is unmatched in flexibility. If you use it, you can check access like
Yii::app->user->checkAccess('post.create')
, and many other things.