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

Jump to content

  • (32 Pages)
  • +
  • « First
  • 29
  • 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

#601 User is offline   mrkoeh 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 31-October 12
  • Location:Indonesia

Posted 14 February 2013 - 10:59 PM

can anyone help me??
i have an error like this :

Quote

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'userid' in 'where clause'. The SQL statement executed was: SELECT *
FROM `pengguna`
WHERE userid=:userid

whats the solution??

sorry to my bad english. .
thanks before. ..
1

#602 User is offline   Joshua Tam 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 19-April 11

Posted 25 February 2013 - 01:15 AM

Hi,

Thanks for your work in this module, it was very good when integrating in my projects.

Currently, we have upgraded to Yii v1.1.13, and we found the rights unable to use.
Previously we use Yii v1.1.12.

Please help to solve this problem, thanks a lot!
0

#603 User is offline   mk87 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 23-March 13

Posted 23 March 2013 - 07:00 PM

Hello, I'm having some issues with Rights.

Ok, so the authentication simply does not work. I realised that if I change the values of userid column in the authassignment table from user id to user name it will work...

Attached File(s)


0

#604 User is offline   devnew 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 05-March 13

Posted 10 April 2013 - 05:14 AM

Dear all

First of all thank you Chris for "rights" and users contributing in this forum to let people use it at best! need help, want to know the missing part in yii rights module implementation.

- module successfully installed (both user & rights)
- removed access rules from main controller
- can view the panel with option

Assignments
Permissions
Roles
Tasks
Operations

- created roles, assigned to user.
for example: sub admin to create users, assigned that to newly created user.
- the new user is not working with assigned rights.

Whats the missing step?

Thanks in Advance.
0

#605 User is offline   Joemaxwell 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 13-February 13
  • Location:Fiji Via Melbourne

Posted 16 April 2013 - 06:33 PM

View PostRaoul, on 11 April 2011 - 06:40 AM, said:

... I tried again a fresh install and confirm that following tables are created :

  • authassignment,
  • authitem
  • authitemchild
  • rights

They are also populated, however the problem seems to be that the authassignment table contains :

  • itemname = 'admin'
  • userid = 'admin'
  • bizrule = null
  • data = 'N;'

... Now if I manually edit the userid column and set its value to 1 (which is the id of the 'admin' user in the 'user' table) everything works fine.

Regards

8)



How do you manage to edit the userid column and set its value to 1 can you write the mysql code. for this.
0

#606 User is offline   Joemaxwell 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 13-February 13
  • Location:Fiji Via Melbourne

Posted 16 April 2013 - 08:50 PM


Hi Chris

I have this error on my installation can you help me out on this please.
Anyone is much appreciated.



Error 403
There must be at least one superuser!
Best Regards.
0

#607 User is online   Raoul 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 643
  • Joined: 29-November 08
  • Location:Paris, France

Posted 17 April 2013 - 01:57 AM

View PostJoemaxwell, on 16 April 2013 - 06:33 PM, said:

How do you manage to edit the userid column and set its value to 1 can you write the mysql code. for this.


I'm using phpmyAdmin ;)
0

#608 User is offline   Nur Rochim 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 42
  • Joined: 04-February 13
  • Location:Indonesia

  Posted 20 April 2013 - 10:34 AM

View PostChris83, on 19 July 2010 - 03:16 PM, said:

Posted Image

Rights utilizes Yii's built-in database auth manager (CDbAuthManager) to provide a solid web interface for extensive access control.

Features:

  • User interface optimized for usability
  • Role, task and operation management
  • View displaying each role's assigned tasks and operations
  • Assigning authorization items to users
  • Sorting of authorization items by dragging and dropping
  • Installer for easy and quick set up
  • Authorization item generation
  • Controller filter for checking access
  • Support for business rules (and data)
  • Runtime caching to increase performance
  • Internationalization (I18N)
  • Cross-browser and cross-database compatibility
  • Easy to extend

Try out the demo

Download directly here (updated 10th of April 2011):
Yii Extensions or Google Code

Yii Blog demo with Rights available here (updated 10th of April 2011):
Yii Extensions or Google Code

Detailed documentation can be found here (Updated 11th of January 2011):
Rights documentation

Project can be found here:
Yii Extensions and Google Code

Downloads: Google Code
Checkout: Google Code

More about Rights on Ohloh.

Having trouble with the module?
Take a look at the documentation or the blog example.
You can also post your questions below and I'll try to answer them as soon as possible.

If you happen to find a bug please report it here or on Google Code and I'll take a look as soon as possible.

Screenshots of the interface (version 1.1.0):

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Posted Image

Thank you for reading.


I have a problem, please help me.

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`demo`.`authassignment`, CONSTRAINT `authassignment_ibfk_1` FOREIGN KEY (`itemname`) REFERENCES `AuthItem` (`name`) ON DELETE CASCADE ON UPDATE CASCADE). The SQL statement executed was: INSERT INTO `AuthAssignment` (`itemname`, `userid`, `bizrule`, `data`) VALUES (:itemname, :userid, :bizrule, :data)

it's after adding assign item to roles.
0

#609 User is offline   tzoll 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 74
  • Joined: 28-February 13

Posted 24 April 2013 - 02:39 AM

Hello. I installed yii-rights, which created 4 db tables: AuthAssignment, AuthItem, AuthItemChild, Rights. First 3 dbtables: AuthAssignment, AuthItem, AuthItemChild are populated with data, but last table: Rights is always blank. Is this normal situation?

Thanks for reply
Tom
0

#610 User is offline   hemc 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 87
  • Joined: 09-July 12
  • Location:New Delhi

Posted 26 April 2013 - 07:26 AM

I have two Controllers
1.CustomercareController
2.ReportsController

And i have created some new role for account to reports and ccare to customercare.
Images are attached.

Problem:-
When logged in with Accountant i can access all the controller actions of both controllers.

Is there anything i have to change in Controllers?
OR should do some change in business rules.

Please guide me what i missed.


SOLVED:- Forgot to apply filters in controllers. and extend RController.

Attached File(s)


Please don't add a reply to say thanks, There is already a +1 button to do same.
0

#611 User is offline   skeef 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 02-September 11
  • Location:Sevastopol, Ukraine

Posted 30 April 2013 - 04:05 AM

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
Processor not found! Software emulation ...
0

#612 User is offline   FRG 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 06-June 13

Posted 10 June 2013 - 12:58 AM

Can anyone help me?
How to configure the module to work with the Oracle?
0

#613 User is offline   pencilkiller 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 11-March 13

Posted 18 June 2013 - 04:27 AM

View Postdevnew, on 10 April 2013 - 05:14 AM, said:

Dear all

First of all thank you Chris for "rights" and users contributing in this forum to let people use it at best! need help, want to know the missing part in yii rights module implementation.

- module successfully installed (both user & rights)
- removed access rules from main controller
- can view the panel with option

Assignments
Permissions
Roles
Tasks
Operations

- created roles, assigned to user.
for example: sub admin to create users, assigned that to newly created user.
- the new user is not working with assigned rights.

Whats the missing step?

Thanks in Advance.



check this:
http://www.yiiframew...ghts-extension/
0

#614 User is offline   Ddd 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 26-April 13

Posted 07 July 2013 - 11:59 AM

Is there a way to uninstall the extension from my Yii project?
0

#615 User is offline   Amini 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 29-December 12

Posted 09 July 2013 - 04:11 AM

Hi, I
I am using the RBAC in my Application. I want to show the access levels for user choice.
How to do it?

for example show permission in tree view(all permission or special roles)
0

#616 User is offline   jfmerveille 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 15-July 13

Posted 15 July 2013 - 12:21 PM

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


Hi !,

Arrived at step 8, I get the error message 'Application manager must extend the authorization RDbAuthManager class. "

Any idea?


The version I am trying to install is: yii-rights-1.3.0.r147

File Config (Main.php)
<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

// 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'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'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'=>'Enter Your Password Here',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		*/
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
			'class'=>'RWebUser', // Allows super users access implicitly.
		),
		'authManager'=>array( 
			'class'=>'RDbAuthManager', // Provides support authorization item sorting.
			'connectionID'=>'db',
		),
		// 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=project',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => 'root',
			'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',
	),
	
	    'theme'=>'bootstrap', // requires you to copy the theme under your themes directory
		'modules'=>array(
			'gii'=>array(
				'generatorPaths'=>array(
					'bootstrap.gii',
				),
			),
			'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' => true,
			),
		),
    'components'=>array(
        'bootstrap'=>array(
            'class'=>'bootstrap.components.Bootstrap',
        ),
    ),

);

0

#617 User is offline   knaingko 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 19-July 13

Posted 19 July 2013 - 10:26 PM

Hello,
I am new in Yii framework. I want to use your extension, but can't see demo. I use Chrome browser. I already logon with admin/admin. What I need to do?

With regards,
KnaingKo
0

#618 User is offline   kirkhansen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 16-August 13

Posted 16 August 2013 - 04:41 PM

All,

I'm quite new to Yii, so I hope I haven't overlooked something simple and obvious through my searching of documentation.
I believe rights was successfully installed on my machine (I can add things, and they are populated in my database...). The problem is that the authorization seems to be failing. I believe this is due to the fact that Yii doesn't think the admin user is actually a superuser.
I've attached screen shots of code that displays if the logged in user isSuperuser and a dump of the array supeusers from the rights module.

Can anyone explain why rights has the superusers in it's array, yet the logged in user is not set to superuser? Also, I'm logged in as 'kirk' and thus have access to 'rights' but no other page...

Controllers filters are set to 'rights'. Controllers are extending RController. I only have the rights module (no yii users extension).

If more info is required, I'll be more than happy to give you more. Thanks in advance!

Also, I'm using Yii 1.1.13. (Although I'm certain this is not part of the issue as the blog demo runs correctly using the same yii framework...).

<------------------------->
Solved it. It was an error in the database and Yii configuration. Yii was using a column (username) to assign the user->id verses rights using the column user_id. Once I created my own _id and assigned it the correct id and fixed the columns in my database it worked.

Attached File(s)


This post has been edited by kirkhansen: 19 August 2013 - 02:23 PM

0

#619 User is offline   godzilla 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 07-October 12

Posted 18 August 2013 - 10:58 PM

Using Yii-rights + Yii-user module in my project. In Rights, I generated operations based on my controller action, under update I added a child UpdateOwn.

For UpdateOwn, the bizrule is suppose to be a simple comparison that the logged in user's ID is equal to $model->user_id field.

I understand yii checkaccess allow you to pass in variables as parameters and comparing with your defined bizrule. But how does it work for Yii-rights module? How or what are the data/params passed in to be used in bizrule? How can I define or pass my own data/params?
0

#620 User is offline   dans 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 20
  • Joined: 21-October 10

Posted 20 August 2013 - 07:39 AM

Hey all, Using Yii Rights and it's awesome, thanks!!

I have restructured my application to use nested modules (ie. /backend/administration/category/) Administration is a sub module of Backend. Category is a Controller.
When I "Generate controller actions" it creates "Administration.Category.*", however when I try to grant access to this permission to a role, I get a 403.
Is there any issues in using nested modules, and Yii rights?
Thanks!
----
UPDATE:
Ok, I've just run some tests.. I've looked into RightsFilter.php, and the preFilter() function. $authItem, which is derived from "ucfirst($controller->id);" returns "Backend/administration.Category".
When the controller items are generated, it generates Administration.Category.*.
So the Administration module (child to "Backend") is being incorporated into the controller name.
Is this me doing something wrong??
Does anyone have any suggestions on how to elegantly fix this?
Cheers
Dan
---
UPDATE 2:
I've modified the rules by changing it from "Administration.Controller.*", to be "Backend/administration.Controller.*", which is working.
However I feel I may have done something wrong? Does anyone else have this issue? Or a solution to this issue?

This post has been edited by dans: 21 August 2013 - 07:25 AM

0

Share this topic:


  • (32 Pages)
  • +
  • « First
  • 29
  • 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