HELP! SRBAC install error.

hi, Spyros:

I have some problem when use srbac:

  1. download the code from svn http://srbac.googlecode.com/svn/trunk/

  2. copy the srbac to myapp/protected/modules

  3. config the config/main.php

[indent]




return array(

	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

	'name'=>'My Web Application',


	// preloading 'log' component

	'preload'=>array('log'),


	// autoloading model and component classes

	'import'=>array(

		'application.models.*',

		'application.components.*',

		'application.modules.srbac.controllers.SBaseController',

	),

	'modules'=>array(

        'srbac' => array(

			'userclass'=>'User',

			'userid'=>'id',

			'username'=>'name',

			'debug'=>true,

			'pageSize'=>10,

			'superUser' =>'Authority',

			'css'=>'srbac_red.css',

			'layout'=>'application.views.layouts.admin',

			'notAuthorizedView'=>'application.views.site.unauthorized',

			'alwaysAllowed'=>array('SiteLogin','SiteLogout','SiteIndex','SiteAdmin','SiteError', 'SiteContact'),

			'userActions'=>array('Show','View','List'),

			'listBoxNumberOfLines' => 15,

			'imagesPath' => 15,

			'imagesPack'=>'noia',

			'iconText'=>true,

			'header'=>'application.views.header',

			'footer'=>'application.views.footer',

			'showHeader'=>true,

			'showFooter'=>true,

		)

    ),


	// application components

	'components'=>array(

		'log'=>array(

			'class'=>'CLogRouter',

			'routes'=>array(

				array(

					'class'=>'CFileLogRoute',

					'levels'=>'error, warning',

				),

			),

		),

		'user'=>array(

			// enable cookie-based authentication

			'allowAutoLogin'=>true,

		),

		// uncomment the following to set up database

		/*

		'db'=>array(

			'connectionString'=>'Your DSN',

		),

		*/

		'db'=>array(

			'connectionString'=>'mysql:host=127.0.0.1;dbname=myapp', 'username'=>'myapp', 'password'=>'myapp'

		),

		///////////////////////////////////////////////////////////////////////////////////////

		// SRBAC

		///////////////////////////////////////////////////////////////////////////////////////

		'authManager'=>array(

			// The type of Manager (Database)

			'class'=>'CDbAuthManager',

			// The database component used

			'connectionID'=>'db',

			// The itemTable name (default:authitem)

			'itemTable'=>'items',

			// The assignmentTable name (default:authassignment)

			'assignmentTable'=>'assignments',

			// The itemChildTable name (default:authitemchild)

			'itemChildTable'=>'itemchildren',

		),

	),


	// application-level parameters that can be accessed

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

	'params'=>array(

		// this is used in contact page

		'adminEmail'=>'webmaster@example.com',

	),

);



[/indent]

  1. visit the url : http://127.0.0.1/index.php?r=srbac/authitem/install

  2. show me the message :

....


There is an error in your configuration


Create demo authItems?





and the [install] button is gray.

how can i do with these problem?

detail :

see the attachments image.

the detail image:

425

1262225284.JPG

Do not use ‘css’=>‘srbac_red.css’,

That’s an example

Use

‘css’=>‘srbac.css’,

Hi, Spyros,

I changed the css to srbac.css , and show the message:

notAuthorizedView [color="#FF0000"]application.views.site.unauthorized[/color]

layout [color="#FF0000"]application.views.layouts.admin[/color]

imagesPath [color="#FF0000"]15[/color]

imagesPack noia

header [color="#FF0000"]application.views.header[/color]

footer [color="#FF0000"]application.views.footer[/color]

and what this means?

how can i do?

It means that these customized alias do not point to an existing file

If you want to use the default settings remove them from the configuration

thanks Spyros!

just now I got it works ok.

but some where i am not understand…

[b] [color="#FF0000"][the old config][/color]

[/b]




        'srbac' => array(

                        'userclass'=>'User',

                        'userid'=>'user_ID',

                        'username'=>'username',

                        'debug'=>true,

                        'pageSize'=>10,

                        'superUser' =>'Authority',

                        'css'=>'srbac_red.css',

                        'layout'=>'application.views.layouts.admin',

                        'notAuthorizedView'=>'application.views.site.unauthorized',

                        'alwaysAllowed'=>array('SiteLogin','SiteLogout','SiteIndex','SiteAdmin','SiteError', 'SiteContact'),

                        'userActions'=>array('Show','View','List'),

                        'listBoxNumberOfLines' => 15,

                        'imagesPath' => 15,

                        'imagesPack'=>'noia',

                        'iconText'=>true,

                        'header'=>'application.views.header',

                        'footer'=>'application.views.footer',

                        'showHeader'=>true,

                        'showFooter'=>true,

                )




[b] [color="#FF0000"]after changed to below, works ok:[/color]

[/b]




        'srbac' => array(

                        'userclass'=>'User',

                        'userid'=>'id',

                        'username'=>'name',

                        'debug'=>true,

                        'pageSize'=>10,

                        'superUser' =>'super', <<==========changed

                        'css'=>'srbac.css',

                        'layout'=>'application.views.layouts.main', <<==========changed,use the main layout : main.php

                        'notAuthorizedView'=>'application.views.site.login', <<==========changed,use the main layout

                        'alwaysAllowed'=>array('Show','View','List'), <<==========changed,

                        'userActions'=>array('Show','View','List'), <<==========changed,

                        'listBoxNumberOfLines' => 15,

                        //'imagesPath' => 15, <<==========changed to comments, but dont understand why the path is a Number???

                        'imagesPack'=>'noia', <<========== what's noia???

                        'iconText'=>true, 

                        //'header'=>'application.views.header', <<==========changed,use the main layout

                        //'footer'=>'application.views.footer',<<==========changed,use the main layout

                        //'showHeader'=>true,<<<==========changed,use the main layout

                        //'showFooter'=>true,<<==========changed,use the main layout

                )




thanks a lot!

My Config:

‘modules’=>array(

	'srbac' =&gt; array( 


		 'userclass'=&gt;'User', //optional defaults to User 


		 'userid'=&gt;'id', //optional defaults to userid 


		 'username'=&gt;'un', //optional defaults to username 


		 'debug'=&gt;true, //optional defaults to false 


		 'pageSize'=&gt;10, //optional defaults to 15 


		 'superUser' =&gt;'Authority', //optional defaults to Authorizer 


		 'css'=&gt;'srbac.css',  //optional defaults to srbac.css 


		// 'layout'=&gt; 'srbac.views.authitem.admin', //optional defaults to empty string 


											 // must be an existing alias 


		 'notAuthorizedView'=&gt;'srbac.views.authitem.unauthorized', // optional defaults to                    


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


		 'alwaysAllowed'=&gt;array(   //optional defaults to gui 


			'SiteLogin','SiteLogout','SiteIndex','SiteAdmin', 


			'SiteError', 'SiteContact'), 


		 'userActions'=&gt;array(//optional defaults to empty array 


			'Show','View','List'), 


		 'listBoxNumberOfLines' =&gt; 15,  //optional defaults to 10 


		 'imagesPath' =&gt; 'srbac.images', //optional defaults to srbac.images 


		 'imagesPack'=&gt;'noia', //optional defaults to noia 


		 'iconText'=&gt;true, //optional defaults to false 


		 'header'=&gt;'srbac.views.authitem.header', //optional defaults to  


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


		 'footer'=&gt;'srbac.views.authItem.footer', //optional defaults to  


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


	 


		 'showHeader'=&gt;true, //optional defaults to false 


		 'showFooter'=&gt;true, //optional defaults to false 


		 'alwaysAllowedPath'=&gt;'srbac.components', //optional defaults to srbac.components 


										// must be an existing alias 


	),


),

But I get error:

There is an error in your configuration

And Install Button is disbled.

I created User model and CRUD for it.

Everything is OK. But I don’t understand why I can’t install.

I use Yii 1.1.0, SRBAC v1.1.0(use Subversion for download)

Please, show me now!!!

Thanks for your help!

That was a typo error in the guide. imagesPath should be an alias , default is srbac.images

noia is the images pack to use (a subdir in srbac/images dir)

‘listBoxNumberOfLines’ => 15, //optional defaults to 10

‘imagesPath’ => ‘srbac.images’, //optional defaults to srbac.images

‘imagesPack’=>‘noia’, //optional defaults to noia

My config copy from your srbac_guide_1.1.0.pdf. If wrong, it’s just you!!! ::)

Hi Thanks for a wonderful module.

Ijust cant seemto get to insatll…directory not found

My config…

Version 1.1.0

	'authManager'=&gt;array(


		// The type of Manager (Database)


		'class'=&gt;'CDbAuthManager',


		// The database component used


		'connectionID'=&gt;'db',


		// The itemTable name (default:authitem)


		'itemTable'=&gt;'items',


		// The assignmentTable name (default:authassignment)


		'assignmentTable'=&gt;'assignments',


		// The itemChildTable name (default:authitemchild)


		'itemChildTable'=&gt;'itemchildren',


		),





// module config stuff


'modules'=&gt;array(


		'srbac' =&gt; array(


				'userclass'=&gt;'User', //optional defaults to User


				'userid'=&gt;'user_ID', //optional defaults to userid


				'username'=&gt;'username', //optional defaults to username


				


				'debug'=&gt;true, //optional defaults to false


				


				'pageSize'=&gt;10, //optional defaults to 15


				'superUser' =&gt;'Authority', //optional defaults to Authorizer


				'css'=&gt;'srbac.css', //optional defaults to srbac.css


				


				//The layout to use


				'layout'=&gt;'application.views.layouts.admin', //optional defaults to empty string


															// must be an existing alias


				


				'notAuthorizedView'=&gt;'srbac.views.authitem.unauthorized ', 


				// optional defaults to


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


				


					'alwaysAllowed'=&gt;array( //optional defaults to gui


						'SiteLogin','SiteLogout','SiteIndex','SiteAdmin',


						'SiteError', 'SiteContact'),


					'userActions'=&gt;array(	//optional defaults to empty array


						'Show','View','List'),


				'listBoxNumberOfLines' =&gt; 15, //optional defaults to 10 


				'imagesPath' =&gt; 'srbac.images', //optional defaults to srbac.images 


				'imagesPack'=&gt;'noia', //optional defaults to noia 


				'iconText'=&gt;true, //optional defaults to false 


				


				'header'=&gt;'srbac.views.authitem.header', 


				//optional defaults to


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


				


				'footer'=&gt;'srbac.views.authItem.footer', 


				//optional defaults to


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


				


				'showHeader'=&gt;true, 


				//optional defaults to false 


				


				'showFooter'=&gt;true, 


				//optional defaults to false


				


				'alwaysAllowedPath'=&gt;'srbac.components', 


				//optional defaults to srbac.components


				// must be an existing alias 


		),


	),

I am getting error cant find…

include(User.php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory

need please help…

Do you have a User class in your application?

Yes

Here is the error I get

19:51:52.753035 trace system.web.CModule

Loading "coreMessages" application component

19:51:52.755316 error exception.CHttpException.404

exception ‘CHttpException’ with message 'Unable to resolve the request

“srbac”.’ in C:\xampp\htdocs\yii\framework\web\CWebApplication.php:324

Stack trace:

#0 C:\xampp\htdocs\yii\framework\web\CWebApplication.php(120):

CWebApplication->runController(‘srbac’)

#1 C:\xampp\htdocs\yii\framework\base\CApplication.php(135):

CWebApplication->processRequest()

#2 C:\xampp\htdocs\yii\dealbook\index.php(11): CApplication->run()

#3 {main} REQUEST_URI=/yii/dealbook/index.php/srbac

19:51:52.755633 trace system.web.CModule

Loading "errorHandler" application component

Perhaps you might be able to spot where I have gone wrong…

Following srbac_guide_1.1.0.pdf everything worked after create Yii skeleton code. Just one typo I found in srbac_guide_1.1.0.pdf at Configure srbac module section.

Begin of page 3 there is: 'srbac.views.authitem.unauthorized ',

maybe remove last space in the String then everything ok and install button worked.

Great job Spyros, thanks.

Hey there.

I have similar problem. I have tried many things to fix it but i guess miss something. I’m trying to install SRBAC. I have done instructions in guides. Still have the same problem. It’s about configuration. The problem is: “There is an error in your configuration” and i have no idea what is wrong.I have tried many possibilites to made it working and finally it looks like this.

My configuration:


<?php


return array(

	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

	'name'=>'Page',


	'preload'=>array('log'),


	'import'=>array(

		'application.models.*',

		'application.components.*',

                'application.modules.srbac.controllers.SBaseController',

                       ),

    

	'components'=>array(            

            'authManager'=>array(

                'class'=>'CDbAuthManager',

                'connectionID'=>'db',

                'itemTable'=>'items',

                'assignmentTable'=>'assignments',

                'itemChildTable'=>'itemchildren',

                    ),

                       

            'user'=>array(

			'allowAutoLogin'=>true,   

                         ),

            		

            'db'=>array(

			'connectionString' => 'pgsql:host=localhost;dbname=nameofbase',

			'username' => 'postgres',

			'password' => 'password',

			'charset' => 'utf8',

		),

            'errorHandler'=>array(

            'errorAction'=>'site/error',

        ),		

	),

    

	'modules'=>array(

		'srbac'=>array(

                    "userclass"=>"User",

                    "userid"=>"id",

                    "username"=>"username",

                    "debug"=>true,

                    "pageSize"=>10,

                    "superUser" =>"Authority",

                    "css"=>"srbac.css",

                    "layout"=>"application.views.layouts.main",

                    "notAuthorizedView"=>"application.views.site.unauthorized",

                    "alwaysAllowed"=>array(

                    "SiteLogin","SiteLogout","SiteIndex","SiteAdmin",

                    "SiteError", "SiteContact"),

                    "userActions"=>array(

                    "Show","View","List"),

                    "listBoxNumberOfLines" => 15, 

                    "imagesPath" => "srbac.images", 

                    "imagesPack"=>"noia", 

                    "iconText"=>true,

                    ),

            

		'gii'=>array(

			'class'=>'system.gii.GiiModule',

			'password'=>'password',

		),

		

	),

	'params'=>array(

		'adminEmail'=>'admin@admin.com',

	),

       

);

?>

Final effect:

Your Database, AuthManager and srbac settings:

Database

Driver : pgsql

Connection: pgsql:host=localhost;dbname=nameofbase

AuthManager

Item Table: items

Assignment Table: assignments

Item child table: itemchildren

srbac

yiiSupportedVersion: 1.1.0

version: 1.2

debug: 1

pageSize: 10

alwaysAllowed: SiteLogin, SiteLogout, SiteIndex, SiteAdmin, SiteError, SiteContact

userActions: Show, View, List

listBoxNumberOfLines: 15

iconText: 1

showHeader

showFooter

cssUrl

useAlwaysAllowedGui

message

userid: id

username: username

userclass: User

superUser: Authority

css: srbac.css

notAuthorizedView: application.views.site.unauthorized

imagesPath: srbac.images

imagesPack: noia

header: srbac.views.authitem.header

footer: srbac.views.authitem.footer

alwaysAllowedPath: srbac.components

delimeter: -

layout: application.views.layouts.main

Yii

Yii version: 1.1.6

There is an error in your configuration

Is there a way to check what’s wrong? Thanks in advance.

I have not use srbac with pgsql database so there might be a problem there.

Check if this happen to you

https://code.google.com/p/srbac/issues/detail?id=72

Also check that these point to existing files

"layout"=>"application.views.layouts.main",

"notAuthorizedView"=>"application.views.site.unauthorized"

I have deleted “notAuthorizedView”=>“application.views.site.unauthorized” and it’s working now.

Thank you.

[color="#1C2837"][size="3"]Dear Spyros.[/size][/color]

[color="#1C2837"] [/color]

[color="#1C2837"][size="2"]I got some problem in installation of srbc this is the message after installation:[/size][/color]

[color="#1C2837"] [/color]

[color="#1C2837"][size="2"]Install Srbac[/size][/color]

[font="Arial Black"][size="2"]This is the mESSAGE AFTER INSTALLATION[/size][/font]

[color="#1C2837"][size="2"]"Error while installing srbac.[/size][/color]

[color="#1C2837"][size="2"]Please check your database and try again"[/size][/color]

[color="#1C2837"] [/color]

[color="#1C2837"][size="2"]Extension i use: srbca 1.3beta[/size][/color]

[size=“2”][color=#1C2837]my whole layout can’t display, i don’t see any frame. Before it works perfect this is after i configure my[/color][/size] [color="#1C2837"][size=“2”]Any help is much appreciated.[/size][/color]

I have drop the table at my workbench mysql the three table that the book has.

Dear,

Can i just give a role(not super user and this role has competences into srbac) to someone and he can view srbac? I use this way to do that and it only display a empty page. When i give him a superuser role and everything all right.

Regards,