Hi Chris,
I read all posts but i cant locate a answer to my problem
I have screens working well but Permissions are not work
PHP Error
Undefined variable: permissions
C:\wamp\www\gu\protected\modules\rights\components\RAuthorizer.php(354)
342 {
343 if( $itemName!==null )
344 {
345 $item = $this->_authManager->getAuthItem($itemName);
346 $permissions = $this->getPermissionsRecursive($item);
347 }
348 else
349 {
350 foreach( $this->getRoles() as $roleName=>$role )
351 $permissions[ $roleName ] = $this->getPermissionsRecursive($role);
352 }
353
354 return $permissions;
355 }
356
357 /**
358 * Returns the permissions for a specific authorization item recursively.
359 * @param CAuthItem the item for which to get permissions.
360 * @return array the section of the permissions tree.
361 */
362 private function getPermissionsRecursive(CAuthItem $item)
363 {
364 $permissions = array();
365 foreach( $item->getChildren() as $childName=>$child )
366 {
My config is
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'XXXXX',
// user language (for Locale)
'language'=>'pt_br',
//language for messages and views
'sourceLanguage'=>'pt_br',
// charset to use
'charset'=>'utf-8',
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
//YiiDebug
'application.extensions.yiidebugtb.*', //our extension
//rights extension
'application.modules.rights.*',
'application.modules.rights.components.*', // Correct paths if necessary.
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'1234',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
),
//rights extension
'rights'=>array(
'superuserName'=>'Admin', // Name of the role with super user privileges.
'authenticatedName'=>'Authenticated', // Name of the authenticated user role.
'userIdColumn'=>'id', // Name of the user id column in the database.
'userNameColumn'=>'username', // Name of the user name column in the database.
'enableBizRule'=>true, // Whether to enable authorization item business rules.
'enableBizRuleData'=>false, // Whether to enable data for business rules.
'displayDescription'=>true, // Whether to use item description instead of name.
'flashSuccessKey'=>'RightsSuccess', // Key to use for setting success flash messages.
'flashErrorKey'=>'RightsError', // Key to use for setting error flash messages.
//'install'=>true, // Whether to install rights.
'baseUrl'=>'/rights', // Base URL for Rights. Change if module is nested.
'layout'=>'rights.views.layouts.main', // Layout to use for displaying Rights.
'appLayout'=>'application.views.layouts.main', // Application layout.
//'cssFile'=>'rights.css', // Style sheet file to use for Rights.
'install'=>false, // Whether to enable installer.
'debug'=>true, // Whether to enable debug mode.
//'defaultRoles'=>array('Guest'),
),
),
// application components
'components'=>array(
'user'=>array(
//rights extension
'class'=>'RWebUser',
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
//rights extension
'authManager'=>array(
'class'=>'CDbAuthManager',
'connectionID'=>'db', // as in your database configuraiton
'class'=>'RDbAuthManager', // provides support for authorization item sorting
// assign default roles to all users, then use bizrules in Rights
// to distinguish between 'Guest' and 'Authenticated' users
'defaultRoles'=>array('Guest','Authenticated'),
),
// uncomment the following to enable URLs in path-format
/*
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
*/
'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=gudb',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'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, trace',
),
array( // configuration for the toolbar
'class'=>'XWebDebugRouter',
'config'=>'alignLeft, opaque, runInDebug, fixedPos, collapsed, yamlStyle',
'levels'=>'error, warning, trace, profile, info',
'allowedIPs'=>array('127.0.0.1','192.168.1.3'),
),
// 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'=>'webmaster@example.com',
),
);
Can you help me?
Thanks!