Hi there,
I’m having a bit of a problem implementing Rbac. For the record I’ve used the Web Application DEvelopment with Yii and PHP book for reference.
I’ve created the database tables and populated them with two roles (member and admin)
One task: adminManagement
And a whole load of operations.
I have added a user into the auth_assignment table. The itemname field says ‘admin’ and the userid is 1. The bizrule and data columns are null.
I have an ‘admin’ module that I’m trying to restrict access to.
In protected/modules/admin/AdminModule.php I have added the following into beforeControllerAction():
if(!Yii::app()->user->checkAccess('admin'))
{
throw new CHttpException(403,Yii::t('application','You are not authorized to perform this action.'));
}
return true;
Unfortunately it doesn’t work. When I login as user with id 1 (or any other) I’m denied access to the admin module.
Any help sorting this out would be greatly appreciated.
Thanks in advance!