Yii Framework Forum: [EXTENSION] Rights - Yii Framework Forum

Jump to content

  • (32 Pages)
  • +
  • « First
  • 30
  • 31
  • 32
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] Rights Yii access control evolved. Extensive web interface for CDbAuthManager Rate Topic: ***** 27 Votes

#621 User is offline   chamara 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 47
  • Joined: 05-June 13
  • Location:srilanka

Posted 28 August 2013 - 05:49 AM

i installed rights successfully ,great extension i got the issue when it uploaded to Linux server
Unable to resolve the request "rights/authItem/roles".

i commented the 'caseSensitive'=>false, in urlManager path of main.php

now its working :)
0

#622 User is offline   LeQuoc 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 04-May 12

Posted 03 September 2013 - 02:57 AM

I use rights module and has a problem with checkaccess function, example:
- in MyController (extends RController ):
public function filters()
{
return array('rights');
}
public function allowedActions() {
return 'index'; //public action
}
===> access to url my/index ok , but Yii::app()->user->checkAccess('My.Index') will be return false if user not an admin. How to check if an action is public action?
Help me, please!
0

#623 User is offline   Ganesh Behera 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 29-November 12

Posted 24 September 2013 - 04:56 AM

Application authorization manager must extend the RDbAuthManager class.

Getting this error, when i am trying install
0

#624 User is offline   raiethan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 94
  • Joined: 10-February 12

Posted 08 October 2013 - 12:41 AM

i installed yii rights and it works ok.. my problem is how can i change the them of yii rights? i have themes on my webapplication, i want also to use in my yii rights..
0

#625 User is offline   rafayZia 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 20-September 13
  • Location:Lahore,Pakistan

Posted 12 November 2013 - 07:29 AM

Hi chris. Actually i need help regarding yii rights extension. Actually i am using this extension and i am able to get roles assigned to a user. But i also want to know the user that are assigned to specific role. When i searched for that i got a link http://octathorpeweb...access-control/
in this post writer is using authManager i think. Now my question is that if i want to access the user related to specific role then can i use these commands(methods). Would not it conflict with yii rights extension?
0

#626 User is offline   jafaripur 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 31-October 13
  • Location:Iran

Posted 15 November 2013 - 01:50 PM

hello,

i installed right succesfully and created table for auth and auto make 3 role but when i want to go administrate the role in rights i get this error:
Error 403
You are not authorized to perform this action.

also i login but again get this error.
0

#627 User is offline   Selim 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 27
  • Joined: 12-November 13
  • Location:Dhaka, Bangladesh

Posted 25 November 2013 - 04:18 AM

Hello,

I am using "user" and "rights" extension for creating users and manage them with roles. But this is not working properly.

Created some users by "user" modules

now created task(operation) to assign a user. When I assigned to a user it is not working properly. Could you please help me out ??
0

#628 User is offline   Fire 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 07-August 10

Posted 26 November 2013 - 09:26 AM

View Postskeef, on 30 April 2013 - 04:05 AM, said:

How to install the Rights without error 403!

1. First of all, you must configure authentication using a database. You must configure the creation, deletion user using the database, as well as the login to the site. The users table must be named 'users'.
I use a table users like this:

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `login` varchar(50) NOT NULL,
  `pass` varchar(50) NOT NULL,
  `email` varchar(32) NOT NULL,
  `lang` varchar(2) NOT NULL DEFAULT '',
  `rememberme` int(1) NOT NULL DEFAULT '0',
  `regdate` datetime NOT NULL,
  `last_update` datetime NOT NULL,
  `last_comin` datetime NOT NULL,
  `active` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


2. Create a user with the username 'admin'. His id should be 1 (id=1)

Install the Rights.

4. Unpack the archive in protected/modules/rights

5. Correct the config/main

in Import section:
'import'=>array(

'application.modules.rights.*',
'application.modules.rights.components.*',   // Correct paths if necessary. 
),


in Components section:
'components'=>array(

'user'=>array(
'class'=>'RWebUser',      // Allows super users access implicitly.
//'defaultRoles'=>'Guest',
),


in authManager section:
'authManager'=>array(
'class'=>'RDbAuthManager', 	// Provides support authorization item sorting.

),



in modules section:
'modules'=>array(
		'rights' => array (
				'superuserName' => 'SuperAdmin',
				'authenticatedName' => 'Authenticated',
				'userClass' => 'Users',
				'userIdColumn' => 'id', // Name of the user id column in the database.
				'userNameColumn' => 'login', // Name of the user name column in the database.
				'enableBizRule' => false, // 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.
				'baseUrl' => '/rights', // Base URL for Rights. Change if module is nested.
				'layout' => 'rights.views.layouts.main', // Layout to use for displaying Rights.
				'appLayout' => 'webroot.themes.office.views.layouts.main', // Application layout.
				//'appLayout' => 'application.modules.admin.views.layouts.main', // Application layout.
				//'cssFile' => 'rights.css', // Style sheet file to use for Rights.

			'install' => false,
		),
),


6. Make sure that
'install' => true,


7. Entering a site under the 'admin' account

8. Call mysite/index.php?r=rights or mysite/index.php/rights.

Get:
Congratulations! Rights has been installed succesfully...

or not ... ;))

If you are use 'login' field in the table 'users' as I am, but not the field 'name' as conceived by the author,
You get famous Error 403 There must be at least one superuser!.

You have two ways:

1. Use a table 'users' like this

CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(50) NOT NULL,
  `pass` varchar(50) NOT NULL,
  `email` varchar(32) NOT NULL,
  `lang` varchar(2) NOT NULL DEFAULT '',
  `rememberme` int(1) NOT NULL DEFAULT '0',
  `regdate` datetime NOT NULL,
  `last_update` datetime NOT NULL,
  `last_comin` datetime NOT NULL,
  `active` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;


and run again.

2. Make such magical passes:

2.1. in components/RAuthorizer.php, around line 300, change

$superusers[] = $user->name;

to
$superusers[] = $user->{Rights::module()->userNameColumn};


2.2. in /protected/components/UserIdentity.php add lines:

$this->username = $rec->login;
$this->setState( 'userlogin', $rec->login );
$this->setState( 'name', $rec->name );

(my rquest is: $rec = Users::model()->findByAttributes( array ( 'login' => $this->username ) ); )

2.3. ALTER TABLE `users` ADD `name` VARCHAR( 64 ) NULL AFTER `login`;

2.4. Assign the "admin" value to the "name" field

2.5. Entering under the username 'admin' and call mysite/index.php?r=rights или mysite/index.php/rights

Get:
Congratulations! ...

Now we return everything back

2.6. Delete the line

$this->setState( 'userlogin', $rec->login ); 

in /protected/components/UserIdentity.php

2.7. ALTER TABLE `users` DROP `name`

2.8. Set

'install' => false,

in config/main

-------------------------------------------
And finally,
It is also important that the names of the tables had such this: (note the capital letters)
AuthAssignment, AuthItem, AuthItemChild and Rights

Regards, guys


I was able to install rights with a mixture of things, I followed your instructions, but used this config instead (as in the yii-rights-doc-1.2.0.pdf installation pdf)
	'rights'=>array(
		// Name of the role with super user privileges.
			'superuserName'=>'Admin',
		// Name of the authenticated user role.	
			'authenticatedName'=>'Authenticated',
		// Name of the user id column in the database.	
			'userIdColumn'=>'id',
		// Name of the user name column in the database.
			'userNameColumn'=>'username',
		// Whether to enable authorization item business rules.
			'enableBizRule'=>true,
		// Whether to enable data for business rules.
			'enableBizRuleData'=>false,
		// Whether to use item description instead of name.
			'displayDescription'=>true,
		// Key to use for setting success flash messages.
			'flashSuccessKey'=>'RightsSuccess',
		// Key to use for setting error flash messages.
			'flashErrorKey'=>'RightsError',
		// Whether to install rights.
			'install'=>true,
		// Base URL for Rights. Change if module is nested.
			'baseUrl'=>'/rights',
		// Layout to use for displaying Rights.
			'layout'=>'rights.views.layouts.main',
		// Application layout.
			'appLayout'=>'application.views.layouts.main',
		// Style sheet file to use for Rights.
			'cssFile'=>'rights.css',
		// Whether to enable installer.
			'install'=>false,
		// Whether to enable debug mode.
			'debug'=>false,
),


I also had to insert the following into the database tables:
Posted Image


INSERT INTO `authassignment` (`itemname`, `userid`, `bizrule`, `data`) VALUES ('Admin', '1', NULL, 'N');
INSERT INTO `authitem` (`name`, `type`, `description`, `bizrule`, `data`) VALUES ('Admin', 0, 'Admin', NULL, 'N;');
http://b3dmultitech.com - Delivering Education and Business through 3D Gaming Media
0

#629 User is offline   nirmalroka 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 53
  • Joined: 10-July 12
  • Location:Kathmandu Nepal

Posted 30 December 2013 - 02:22 AM

Hi I am also stuck with right module. This time i am using right modules only, i had installed.

I am asking help for two issue here

1. when i logged in with admin, admin cant able to user other controller until it is assigned the task but it is supperuser as in configuration it must have all rights with out any assignment.

2. second question , I want to restrict the access of right module by other user who are not admin, so how do i achieve this.


Thank you. And i want help from any one who had solved this problem, i may be doing something wrong or please help me or let me know.

<?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'=>'My Web Application',

	// preloading 'log' component
	'preload'=>array('log'),
    'theme'=>'abound',
    'defaultController'=>'news',

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
           'application.modules.right.*',
'application.modules.right.models*',
'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'=>'admin',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
            
            'rights'=>array( 
                   'superuserName'=>'Admin',
              //  'superUsers'=>array(
   // 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'=>false,       // 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,     // Enables the installer. 
             ),
		
	),

	// application components
	'components'=>array(
		'user'=>array(
                    
                    'class'=>'RWebUser',
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
                   // 'loginUrl'=>array('/user/login'),
                    
		),
            
            
            'authManager'=>array( 
                    'class'=>'RDbAuthManager',   
                    'defaultRoles' => array('Guest'),
                'itemTable' => 'authitem',
                'itemChildTable' => 'authitemchild',
                'assignmentTable' => 'authassignment',
                'rightsTable' => 'rights',

                
                
                
                
                //'defaultRoles'=>array('Guest','Authenticated'), // Provides support authorization item sorting. 
    
            ),
               'imagemod' => array(
				//alias to dir, where you unpacked extension
			'class' => 'ext.imagemodifier.CImageModifier',
		),
		// 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=madhesspecialonline',
			'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',
				),
				// 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',
	),
);


0

#630 User is offline   Qixing 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 17-December 13

Posted 27 January 2014 - 07:54 PM

I have some problem with Url manage. I want to user it from module admin.
All my action at http://test.com/admin/news, http://test.com/admi...ws/update/id/22 and e.t.c
Folders:
/modules/
--admin
--front
Where i can put the folder "rights", at admin or at modules.
My url manager
'urlManager' => array(
            'caseSensitive' => false,
            'showScriptName' => false,
            'urlFormat' => 'path',)

0

#631 User is offline   Majid Khan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 10-January 14

Posted 29 January 2014 - 12:48 PM

I have installed rights module. It created all the entries. This is my configuration in the main config file.

	// autoloading model and component classes
	'import'=>array(
                'application.modules.rights.*', // added for rights module
                'application.modules.rights.components.*', // added for rights module
	),

	'modules'=>array(
		// rights module
                '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.
                    '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.
                ),

	),

	// application components
	'components'=>array(
		'user'=>array(
                        'class'=>'RWebUser',
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
                // Rights RDBauthmanager
                'authManager'=>array(
                        'class'=>'RDbAuthManager',
                        'connectionID'=>'db',
                        'defaultRoles'=>array('guest')
                  ),     


1. My controllers extends from RController and also has rights filter. This is the code for my controller.

<?php

class UserController extends RController
{
	/**
	 * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
	 * using two-column layout. See 'protected/views/layouts/column2.php'.
	 */
	public $layout='//layouts/column2';

	/**
	 * @return array action filters
	 */
	public function filters()
	{
		return array(
                        'rights',
			//'accessControl', // perform access control for CRUD operations
			//'postOnly + delete', // we only allow deletion via POST request
		);
	}



I create operations and assign them to roles. Then i assign the role to account.

Isn't this config enough for automatic checking of access using rights filter? It always gives me access denied.

UPDATE: I had Yii defaults access control list enabled in the Controller. Once i commented them all, everything was working OK!

2. I want changes in the layout as per the user role. How do i achieve this? e.g. in
echo Yii::app()->user->checkAccess('ModelControllerActionId')
     ? CHtml::link('update', array('update', 'id'=>$model->id))
     : "";


UPDATE: Tried the following and it worked!

'visible'=>Yii::app()->user->checkAccess('Branch.Delete')

0

#632 User is offline   boco10 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 11-February 14

Posted 11 February 2014 - 08:51 AM

I have the following error:
Alias "rights.RightsModule" is invalid. Make sure it points to an existing PHP file and the file is readable.

I followed the installing-yii-users-and-rights-5-steps guide.

I have read somewhere else that can be permission issue, but i am using Windows. (Xampp)

Can anyone help me with this issue?

main.php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','C:\xampp\htdocs\team_page\public_html');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Team Page',
	'theme'=>'bootstrap',
	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'ext.bootstrap-theme.widgets.*',
		'ext.bootstrap-theme.helpers.*',
		'ext.bootstrap-theme.behaviors.*',
        'application.modules.user.models.*',
        'application.modules.user.components.*',
        'application.modules.rights.*',
        'application.modules.rights.components.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		'user'=>array(
				'tableUsers' => 'users',
				'tableProfiles' => 'profiles',
				'tableProfileFields' => 'profiles_fields',
		),
		'rights'=>array(
				'install'=>true,
		),
			
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'passz',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
			'generatorPaths'=>array(
					'ext.bootstrap-theme.gii',
			),
		),
		
	),
		
	// application components
	'components'=>array(

		'user'=>array(
			// enable cookie-based authentication
			//'allowAutoLogin'=>true,
			'class'=>'RWebUser',
			'allowAutoLogin'=>true,
			'loginUrl'=>array('/user/login'),
		),
		'authManager'=>array( 
			'class'=>'RDbAuthManager',
			'connectionID'=>'db',
			'defaultRoles'=>array('Authenticated', 'Guest'),
		),
		// 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=team_page',
			'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',
				),
				// 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',
	),
);

0

#633 User is offline   dodgerid 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 11-August 13

Posted 11 April 2014 - 09:33 PM

Hi,

I have the rights module within my app.

I setup a standard webapp with yii, got everything working, rights module too.

Now my requirement is to use an email address for login purposes and as such have created a class that extends CBaseUserIdentity and UserIdentity extends that, have altered all my LoginForm model and UserIdentity, all that side is good, I login with email and password no problem.

I removed the rights tables to go for re-install as had changed superuser name in config to my email.

My user model is called Parent_Model and it resides in a module called identity so : application.modules.identity.models.Parent_Model.php in yii path terminology.

I have changed the rights userClass to Parent_Model.

When I call index.php?r=rights/install or index.php?r=rights all that is happening is a refresh to home page.

I have been trying to suss this for 3 hours solid and am completely clueless so far.

I included main.php config for your viewing pleasure.

<?php
// NEW MAIN.PHP 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(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Maisie Princess',
    'theme'=>'foundation522',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
        'application.vendors.*',
        'application.modules.identity.models.*', // Authentication Models
        'application.modules.rights.*', // RBAC Controller
        'application.modules.rights.components.*', // RBAC Controller
    ),

	'modules'=>array(
		// uncomment the following to enable the Gii tool

		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'giipass',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1','82.1.174.250'),
		),
        'rights'=>array(
            'superuserName'=>'ron.appleton@gmail.com', // 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'=>'email', // Name of the email 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'=>false, // 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.themes.foundation522.views.layouts.main', // Application layout.
            'cssFile'=>'rights.css', // Style sheet file to use for Rights.
            'debug'=>false, // Whether to enable debug mode.
            'userClass' => 'Parent_Model',
        ),

        'identity' => array(),

        'user' => array(),

        'meritgenerator' => array(),

        'treats' => array(),

    ),

	// application components
	'components'=>array(
		'user'=>array(
            'class'=>'RWebUser', // Allows super users access implicitly.
            // enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
        'authManager'=>array(
            'class'=>'RDbAuthManager',
            'connectionID'=>'db',
            'itemTable'=>'AuthItem',
            'itemChildTable'=>'AuthItemChild',
            'assignmentTable'=>'AuthAssignment',
            'rightsTable'=>'Rights',
        ),
    // 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(
                        EXCLUDED DETAILS!
        ),
		'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'=>'webmaster@example.com',
	),
);


You will see that I am also using Foundation522, however have tried it without etcetera.

Any help greatly appreciated, Thanks

EDIT:

I thought it was worth mentioning that, all the changes had actually worked, having cleared the browsers history, temp files and cookies it began working properly.

So it is worth noting that the model does not actually have to be called User, neither does the username column need to be titled anything specific.

I Still have layout issues, in that Rights is coming up with a very plain page with no templating, but when I have time I will crack that, reading through here will probably solve that, a little more complicated by using foundation, but well worth it.

I would like to say that the fine grained control, and ability to set permissions within the controllers (If you want.) Makes rights the extension of choice for me as it is very straight forward to use and makes the learning curve very, very soft indeed, I am completely comfortable with only 3 days use, and rbac is a new concept to me.

I would like to see a detailed tutorial part to the user guide regarding using business rules, how to create and use, a dummies version if you like, but other than that, this extension is superb, and going to the extensions site also showed me that maintenance of the code is on going.

My hat is off to the team developing this, you on to a winner.

If you havn't already, I would seriously consider putting a commercial support plan together for it.
0

#634 User is offline   Kyvan_R 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 10-May 14

Posted 15 June 2014 - 06:01 PM

hi all

i have problem

Filter "rights" is invalid. Controller "AdminController" does not have the filter method "filterrights".


AdminController is :

	public function filters()
	{
		return array(

                         'rights', 
		);
	}


plz help :(
0

#635 User is offline   ashutosh nigam 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 16-October 13

Posted 22 October 2014 - 10:20 PM

I am new to Yii. I was looking for a way to provide visibility based on data. I mean,

1) if the data record was created by the user then show it.
2) If the record is created by or assigned to reportee then show it.

Can we handle these situations using this module?
0

Share this topic:


  • (32 Pages)
  • +
  • « First
  • 30
  • 31
  • 32
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users