Hi, I am a relative newbie to Yii and srbac, so sorry for this question if it’s too simple. I have configured srbac, but can’t get to the ?r=srbac page at all, nor other pages in my site. I suspect I have not fully set up something, but the error I get is: Property “CWebApplication.authManager” is read only. (/Applications/MAMP/htdocs/yii/framework/base/CModule.php(435)). These seems really basic, but I don’t understand it. Here is my config:
<?php
// 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(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'JPIM',
// 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',
),
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
/*
'db'=>array(
'connectionString' => 'sqlite:protected/data/testdrive.db',
),
*/
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=192.168.1.98;dbname=xxx;port=8889',
'emulatePrepare' => true,
'username' => 'xxx',
'password' => 'xxx',
'charset' => 'utf8',
),
'errorHandler'=>array(
// use 'site/error' action to display errors
'errorAction'=>'site/error',
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'jon.herstein@gmail.com',
),
'authManager'=>array(
// The type of Manager (Database)
'class'=>'CDbAuthManager',
// The database component used
'connectionID'=>'db',
// The itemTable name (default:authitem)
'itemTable'=>'authitem',
// The assignmentTable name (default:authassignment)
'assignmentTable'=>'authassignment',
// The itemChildTable name (default:authitemchild)
'itemChildTable'=>'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
'layout'=>'application.views.layouts.admin', //optional defaults to empty string must be an existing alias
'notAuthorizedView'=>'srbac.views.authitem.unauthorized ', // optional defaults to srbac.views.authitem.unauthorized, must be an existing alias
'alwaysAllowed'=>array(
//optional defaults to gui
'SiteLogin','SiteLogout','SiteIndex','SiteAdmin',
'SiteError', 'SiteContact'
),
'userActions'=>array(
//optional defaults to empty array
'Show','View','List'
),
'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
),
);
Any and all help welcome - what am I missing?!