Yii Framework Forum: Check access for all actions and return true if the user has one - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Check access for all actions and return true if the user has one Rate Topic: -----

#1 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 03 February 2011 - 07:04 AM

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?
0

#2 User is offline   cactork 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 22
  • Joined: 30-October 10
  • Location:Buenos Aires, Argentina.

Posted 19 February 2011 - 11:11 AM

View Postthiagovidal, on 03 February 2011 - 07:04 AM, said:

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.yiiframew...tension-rights/

Hope that helps you
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users