Check access for all actions and return true if the user has one

Hi folks. I just started to work with rbac and I’m still learning. So sorry the dumb questions.

Scenario:

I have a portlet with a lot of links to controllers actions. I can toggle the visibility of links by checking the access to that controller action like

Yii::app()->user->checkAccess(‘Controller.Action’).

It’s working fine. But some users won’t have access to the portlet. I know i can create a new task or operation to define whatever the user will see the portlet. (I know my client wont be able to do this.) I dealing with a lot o portlets and I need to check if the user has access to some controller/action and if yes render the portlet otherwise no.

So how can I check if the user has access to one permission?

Hi thiagovidal,

I don’t have any clue how to do that, but you can check out the code of this awesome extension.

http://www.yiiframework.com/forum/index.php?/topic/10556-extension-rights/

Hope that helps you