Yii 1.1: rights

Rights - Yii access control evolved
170 followers

Yii-Rights on Ohloh

Introduction

Current version 1.3.0 (revision 147)

This extension utilizes Yii's built-in Database Authorization Manager (CDbAuthManager) to provide a web interface for advanced access control.

View screenshots

Demo

Follow the link below to try Rights on the Yii Blog demo. Please contact me if it doesn't work or seems messed up and I will fix it as soon as possible.

Try the demo

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

Resources

Translations

Rights is currently translated into Finnish, French, German, Greek, Hungarian, Italian, Japanese, Spanish, Simplified Chinese and Swedish. Please contact me if you wish to translate Rights.

Donate

Want to say thanks for the time and efforts put on this project?

Donate with PayPal

Change Log

April 1, 2011

  • Release 1.3.0
    • Installer now uses the schema.sql in the data folder
    • Installer now names tables according to the application configuration
    • Generator now creates tasks for {ControllerId}.* permissions
    • Optimized the getting of superusers
    • Fixed the problem that access was granted to Rights when no superuser were found
    • Fixed most issues reported on Google Code

January 11, 2011

  • Release 1.2.0
    • Assigned items are now divided into Roles, Tasks and Operations
    • Renamed most of the component classes to be prefixed with ‘R’ for consistence
    • Configuration parameter for whether to display item description instead of name
    • Configuration parameter for the application layout.
    • Removed the guestName configuration parameter, web user guestName will be used instead
    • Changed the forms to not use the form builder for convenience
    • Return URLs are now stored with the web user
    • Authorization item names are now URL encoded when passed as get parameters

December 16, 2010

  • Release 1.1.0
    • Optimization by runtime caching authorization items and their children
    • Improved the authorization manager and authorizer
    • Minor user interface improvements
    • Proper support for CSRF validation in authorization item sorting
    • Renamed the AuthItemWeight table to Rights

October 27, 2010

  • Release 1.0.0
    • Official release

September 5, 2010

  • Release 0.9.11
    • User interface improvements (UI reviewed for usability)
    • Description is now mainly used instead of the name
    • Even more intensive use of grid view
    • Minor generator improvements
    • Runtime caching of the module and its components
    • Proper support for overriding the module style

August 28, 2010

  • Release 0.9.10
    • Use of grid views and data providers
    • Proper authorization item sorting according to weights
    • An own user behavior
    • Generator now also looks for controllers in subfolders

August 13, 2010

  • Release 0.9.9b
    • Fixed a somewhat critical bug in the installer which cased the installer to not run correctly.

August 11, 2010

  • Release 0.9.9
    • Improved authorization item generation
    • Improved installer
    • Improved module configuration
    • Rewritten style sheet for easier styling

August 4, 2010

  • Release 0.9.8
    • Authorization item generator
    • Installer automation
    • Improved support for module nesting

July 31, 2010

  • Release 0.9.7
    • Module nesting
    • Flash messages
    • Authorization item sorting
    • Hover functionality for tables
    • German translation (thanks g3ck0)
    • Italian translation (thanks joeysantiago)

July 28, 2010

  • Release 0.9.5
    • Support for custom style sheets
    • Swedish translation

July 26, 2010

  • Release 0.9.3
    • Rights Installer
    • Improved module configuration
    • Pagination for Assignments

July 20, 2010

  • Release 0.9.2
    • Internationalization (I18N)
    • Finnish translation

July 19, 2010

  • Release 0.9.1
    • Initial release

Total 20 comments

#18721 report it
sushant_d84 at 2014/12/17 08:14am
Mongo DB?

Hi , Is there a separate version for Mongo DB.

I am in need of Yii Mongo and right module

#18447 report it
Rajith R at 2014/10/30 02:56am
@Mariaczi+PL

Please try a rewrite .

#18445 report it
Kkk at 2014/10/29 08:41pm
Demo doesn't work

Hi! The domain (http://www.cniska.net/) is not working!!!

#18402 report it
Mariaczi+PL at 2014/10/24 08:09am
Compatible with Yii 2?

Is it? Is someone going to update this great extension?

#18231 report it
Rajith R at 2014/10/02 06:33am
@Giov

Guest means? Public ?

#18182 report it
Giov at 2014/09/22 01:27pm
Help with config

Hi everybody! one question about rights and user! I have followed this tutorial http://www.yiiframework.com/wiki/423/installing-yii-users-and-rights-to-newly-created-yii-app/ to install them. All fine, i can log with admin and set the rights. Then i modify each controller in my app like this class ArticoloController extends RController{ public function filters(){ return array('rights'); } } And now if i open the page without logging me he redirect me to the login page! I set all the permission for the guest, so this is not what i want!

Even, i set the permission from this page r=rights/authItem/permissions. In my idea the item Site.* is a global item that have inside him Site.Contact, Site.Error and Site.Index. It's right? So i can set only the Site.*, right?

Last question, when i read Revoke it's mean that the guest have the permission and when i read Assign it's mean that the guest have not the permission, right? I have check in the db table and i can see the item in the table when i read Revoke.

Thanks for all the help!!!

#17156 report it
Rajith R at 2014/05/08 07:17am
@Loren

Thank you for the information.

Where you got that error?

#17064 report it
Loren at 2014/04/29 03:57pm
Bug In RAutherizer.php

If you expirience problems with the usernames not working and getting a permision denied error with the main rights page, you probably need to integrate this change, https://bitbucket.org/Crisu83/yii-rights/pull-request/6/use-usernamecolumn-from-config/diff

Please merge this into the main distribution.

#16856 report it
Rajith R at 2014/04/04 01:28am
@learningyii
  1. Yes
  2. No. we cant directly upgrade a yii 1.x application to yii 2.0 .
#16785 report it
Fire at 2014/03/27 08:51am
@b3atb0x

@b3atb0x, tried to add the following to my composer file "Webkadabra/yii-rights":"dev-master" but it says your package is not found, what do I add to composer to get your version to install?

#16747 report it
learningyii at 2014/03/25 05:00am
Upgraded version for Yii 2.0?

I love this extension and thinking to use in my current project. However, I would like to confirm some doubts.

1) Is this extension still maintained?

2) Is it going to be upgraded for Yii 2.0?

Thanks

#16651 report it
Kkk at 2014/03/15 09:10am
SORT OPERATIONS

Hi, very good extension!!! I need to order the gridview by name and description in operations's view. Please help me! This is my AuthItemController:

public function actionOperations()
    {
        $sort = new CSort();
        $sort->defaultOrder= 'name asc';
        $sort->attributes = array(
            'name' => array(
                'asc' => 'authitem.name asc',
                'desc' => 'authitem.name desc',
            ),
            'description' => array(
                'asc' => 'authitem.description asc',
                'desc' => 'authitem.description desc',
            ),
            '*',
        );
 
        Yii::app()->user->rightsReturnUrl = array('authItem/operations');
 
        $dataProvider = new RAuthItemDataProvider('operations', array(
            'type' => CAuthItem::TYPE_OPERATION,
            'sort' => $sort,
            'sortable' => array(
                'id' => 'RightsOperationTableSort',
                'element' => '.operation-table',
                'url' => $this->createUrl('authItem/sortable'),
            ),
        ));
#16382 report it
Rajith R at 2014/02/17 07:00am
@Kkk

Use urlmanager at config (config/main)

#16378 report it
Kkk at 2014/02/17 12:31am
Different URL

How can I change the default url? I want it: path/to/application/index.php?r=permisos

#15546 report it
mostofa62 at 2013/11/20 06:49am
how to use the business rules in right interface

i have post model and according its crud. i want to apply role :author,reader,editor 1.where author can only edit,his own post 2.editor can only edit and delete his own post how to right in ,when i create a task and the format of business rules in the field means the php code.

what is $param value means $param['user_id'] example with image or web is good for me. i am stuck here rights-business-question

#15493 report it
Rajith R at 2013/11/15 01:49am
@mostofa62

I think yes, you can

Read this

http://www.opensource.org/licenses/bsd-license.php

#15482 report it
mostofa62 at 2013/11/14 05:05am
Awsome,I have done every with short touch of code

hello i feel really good with this extension, it save my time, can i use it any commercial project of me? thank you advanced

#15267 report it
Rajith R at 2013/10/22 06:44am
@Shahzad Thathal

its surely your mismatch.

check the role and assigned operations/tasks.

also check the user for the role.

#15261 report it
Muhammad Shahzad at 2013/10/22 02:48am
How to assign permissions

I need to assign permission at the time of user creation,Like controller/action. I assigned a Role to user now When user after login when go to controller/action(user/profile) its show a error you are not authorized to perform this action. but when I go to rights module and assign this permission controller/action to this user,it is working, How I can add permission for this user automatically?

#15020 report it
Rajith R at 2013/09/30 12:55am
@Shahzad Thathal

assign role $authorizer = Yii::app()->getModule("rights")->getAuthorizer(); $authorizer->authManager->assign('clients', $model->id);

From the above example 'clients' is a role name.

So create roles according to your preference and assign dynamically at the time of user creation .'$model->id' is the user id. you can also assign any authitem like this other than role.

Leave a comment

Please to leave your comment.

Create extension