Yii Framework Forum: RBAC - checkAccess issue - Yii Framework Forum

Jump to content

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

RBAC - checkAccess issue Rate Topic: -----

#1 User is offline   manilodisan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 17-September 09
  • Location:Bucharest

Posted 20 October 2009 - 04:07 PM

I have the following relations in AuthItemChild:
Posted Image

As you can see Administrator role has access to manageUsers task which has updateUser as one of it's child operations. When I check for
Yii::app ()->user->checkAccess ( 'updateUser' )
on a user which has the administrator role assigned to it, it always returns FALSE. Any idea why? Maybe I'm not understanding the RBAC system well.
0

#2 User is offline   manilodisan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 80
  • Joined: 17-September 09
  • Location:Bucharest

Posted 21 October 2009 - 05:47 AM

Bump...anyone?! :P
0

#3 User is offline   bas_vdl 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 215
  • Joined: 01-April 09

Posted 28 October 2009 - 08:13 AM

i'm using the beforeAction() to check if a user is allowed to use a specific action.

    protected function beforeAction()
    {
        if(Yii::app()->user->checkAccess('action' . ucfirst(Yii::app()->controller->getAction()->getId())))
        {
            return true;
        } else {
            Yii::app()->request->redirect(Yii::app()->user->returnUrl);
        }
    }

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