[MODULE] SRBAC ?r=srbac


I followed the SRBAC guide I am unable to process the below request mentioned there.

Then point your browser to /path/to/application/index.php?r=srbac and you will be redirected to the installation


Error 404

Unable to resolve the request "srbac".

This is the second RBAC module i am trying and getting the same error. So it seems that it is not the mistake of the extension.

Can you please explain what is happening here.

What is your actual url you type?

Do you use any UrlManager?

My testdrive home page is at


and I am typing


I am not using any UrlManager

have you put the srbac configuration in your main.php modules array?

Dear Spyros,

Thanks for your quick reply. Here is my config file.


// uncomment the following to define a path alias

// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable

// CWebApplication properties can be configured here.

return array(


	'name'=>'My Web Application',

	// preloading 'log' component


	// autoloading model and component classes






	// application components



			// enable cookie-based authentication





		// added from larry's page http://blog.dmcinsights.com/2009/11/03/configuring-yii/


	    'urlManager'=> array(




		// uncomment the following to enable URLs in path-format











			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',



		// uncomment the following to use a MySQL database



                        // added for rbac


			'connectionString' => 'mysql:host=localhost;dbname=testdrive',

			'emulatePrepare' => true,

			'username' => 'myusername',

			'password' => 'mypassword',

			'charset' => 'utf8',


                // added for rbac start


                   // The type of Manager (Database)


                   // The database component used


                   // The itemTable name (default:authitem)


                   // The assignmentTable name (default:authassignment)


                   // The itemChildTable name (default:authitemchild)



                'srbac' => array(

                  'userclass'=>'User', //optional defaults to User

                  'userid'=>'user_ID', //optional defaults to userid

                  'username'=>'username', //optional defaults to username

                  'debug'=>true, //optional defaults to false

                  'pageSize'=>10, //optional defaults to 15

                  'superUser' =>'Authority', //optional defaults to Authorizer

                  'css'=>'srbac.css', //optional defaults to srbac.css


                    'application.views.layouts.main', //optional defaults to

                                     // application.views.layouts.main, must be an existing alias


                   'srbac.views.authitem.unauthorized ', // optional defaults to

                                    //srbac.views.authitem.unauthorized, must be an existing alias

                  'alwaysAllowed'=>array(    //optional defaults to gui


                     'SiteError', 'SiteContact'),

                  'userActions'=>array(//optional defaults to empty array


                  'listBoxNumberOfLines' => 15, //optional defaults to 10

                  'imagesPath' => 'srbac.images', //optional defaults to srbac.images

                  'imagesPack'=>'noia', //optional defaults to noia

                  'iconText'=>true, //optional defaults to false

                  'header'=>'srbac.views.authitem.header', //optional defaults to

                                          // srbac.views.authitem.header, must be an existing alias

                  'footer'=>'srbac.views.authitem.footer', //optional defaults to

                                          // srbac.views.authitem.footer, must be an existing alias

                  'showHeader'=>true, //optional defaults to false

                  'showFooter'=>true, //optional defaults to false

                  'alwaysAllowedPath'=>'srbac.components', //optional defaults to srbac.components

                                                  // must be an existing alias


		// rbac addition ends


			// use 'site/error' action to display errors








					'levels'=>'error, warning',


				// uncomment the following to show log messages on web pages









	// application-level parameters that can be accessed

	// using Yii::app()->params['paramName']


		// this is used in contact page





my YII framework and testdrive application is outside my webroot

YII: /home/pannet1/Templates/yii

testdrive webapp: /home/pannet1/Templates/yii/testdrive/

testdrive home page

View file: /home/pannet1/Templates/yii/testdrive/protected/views/site/index.php

Layout file: /home/pannet1/Templates/yii/testdrive/protected/views/layouts/main.php

i am exposing only the testdrive folder as softlink under my webroot like


could this be causing the trouble.

You have put srbac in the components array

You must create a modules array and put srbac config in there

Dear Spyros,


Now it redirects to install page and throws up the below error.

include(User.php): failed to open stream: No such file or directory

I will check the thread to see if you have already given a solution.

Do you have a User class in your application?

No. Where should I create it and what should be basic contents of it.

As i said, I am starting from the scratch with a minimalistic testdrive application.

You should have a User model with at least a user_ID and username attributes

Check the tutorials and the blog demo for details

You could also check the srbac blog demo :


Dear Spyros,

Thank you so much, I will definitely, let you know the outcome.

Dear Spyros,

It is working now after creating a User class. Now I want to know how to replace the default user/user and admin/admin with the one i created (tbl_user). Otherwise, the two (rbac/login) systems seems to be disconnected. In the config, I replaced the line that reads CDBAuthManager into SDBAuthManager.

Can you please help me, I am struck now.

Sorry ignore this. I need to have first implemented the user authentication system as per the example blog application, before RBAC. it is all working now. thanks once again.


here is the latst version


is srbac modules support with postgres, have you been tried before ?

Thank’s Anyways