OK, I got SRBAC installed and can mess with assigning roles etc, but I seem to be having a problem getting it to control access…
Do I have to make changes in each controller file for every action?
In my config/main.php I am importing
'application.modules.srbac.controllers.SBaseController',
but it seems that my controller is still responding to the accessRules() function rather than the roles set up in RBAC. Do I need to remove that section? the documentation only mentions:
If you also want srbac to automatically check for access in your controllers, your controllers should extend the SBaseController class in srbac module or any other class that extends this one.
But it doesn’t say how you DO that…
would that mean that the section of the controller file:
class UserController extends Controller
should be changed to something like:
class UserController extends SBaseController
??
because when I do that I get this error:
CException
Description
Property "UserController.breadcrumbs" is not defined.
Source File
/home/garuda/public_html/bianchini2/protected/views/site/login.php(3)
with the last part of the stack trace:
#0 /home/garuda/public_html/bianchini2/protected/views/site/login.php(3): CComponent->__set('breadcrumbs', Array)
#1 /home/garuda/public_html/yii/framework/web/CBaseController.php(119): require('/home/garuda/pu...')
#2 /home/garuda/public_html/yii/framework/web/CBaseController.php(88): CBaseController->renderInternal('/home/garuda/pu...', Array, true)
#3 /home/garuda/public_html/yii/framework/web/CController.php(732): CBaseController->renderFile('/home/garuda/pu...', Array, true)
#4 /home/garuda/public_html/yii/framework/web/CController.php(671): CController->renderPartial('application.vie...', Array, true)
#5 /home/garuda/public_html/bianchini2/protected/modules/srbac/controllers/SBaseController.php(79): CController->render('application.vie...', Array)
#6 /home/garuda/public_html/bianchini2/protected/modules/srbac/controllers/SBaseController.php(53): SBaseController->onUnauthorizedAccess()
#7 /home/garuda/public_html/yii/framework/web/CController.php(298): SBaseController->beforeAction(Object(CInlineAction))
Except that I am already logged in as admin with full rights…
It would be great to have a full-on, detailed tutorial for SRBAC!