Stuck With Checkaccess

Hi All,

After figuring out how to store and execute operation, task and role using CDbAuthManager. I am stuck with checkAccess.

PFA is the structure of AuthItem, AuthItemChild and AuthAssignment.

I have admin, agent, guest and member as a role. I have given member only readUser access and admin has create and manage user access. I have assigned roles using below code:

$auth->assign(‘member’,1);

$auth->assign(‘member’,‘test1’);

$auth->assign(‘admin’,22);

$auth->assign(‘admin’,‘admin’);

This has made 4 entries in authAssignment table.

Now i dont want to show create and manage url to users other then admin or users whom i give manageUser rights. I am checking for if(Yii::app()->user->checkAccess(‘manageUser’)) in view/user/index.php and its not working. It is still showing me all the urls.

Pl help. I am a newbie and i know such dump questions may irritate but your help would matter a lot to me.

I strongly recommend you check out useful models that will help you manage creation and maintenance of auth items: SRBAC and RBAM. Both are not perfect but do the job for me.