[EXTENSION] Rights

@Greg Fennell: I’m not sure if understood your problem correctly but you should assign your “default authenticated role” (Authenticated) to each user that should have that role. Default roles are assigned to users regardless if they are logged in or not. In my opinion the only default role should be the guest role.

To assign the authenticated role automatically you can use this code in your user controller:




$authenticatedName = Rights::module()->authenticatedName;

Rights::assign($authenticatedName, $user->id);



Does this answer your question?

where do you put this code at what folder?

Hello,

I need help with Yii Extension–Rights. My main.php layout doesn’t work. I already did copy this to my column1 and column 2,

(<?php $this->beginContent(‘application.views.layouts.main’); ?>).

It just gives me an output in list type

-Assignments

-Permissions

-Operations

-Tasks

-Roles

-Generator

instead of something with its images.

Great job, man! (I downloaded the version 1.0.0 running on Yii 1.1.5)

Sounds like the css files aren’t registered. Please check your cssFile configuration (in the module configuration). Also, make sure that the css files do not give a 404 not found.

i already solved this problem. thanks anyways :)

Hi!

The same problem here. I couldn’t see the menu (fresh Yii generated app). I was messing a little bit around, trying to logout, login, no luck. After making changes to layouts/_menu.php, and saving the file (I commented out the first ‘visible’ attribute), the whole menu was there, not only the first button, as expected. I changed it back, and it’s still there. Funny! :)

I’m planning on doing a full review of the module with the goal to even further improve the usability, quality of code and for the first time look into performance.

Since the release of this extension I’ve gotten all kind of suggestions for improvement, which of I have implemented those I’ve seen important. Please note that I do consider every feature request and suggestion for improvement so keep 'em coming.

The initial plan is to release the new version before Christmas.

First of all, congratulations for you good work, I’m new on Yii and I’m trying different extensions and this one is really good, the best rbac module I’ve tried, it’s clear and easy to use.

I added a bug on your google code project, it is related to translations.

"What steps will reproduce the problem?

  1. Set a language in the main configuration file of the application (for example "es")

  2. Try to go to an unauthorized area

What is the expected output? What do you see instead?

If you haven’t access you should receive a 403 error, but it is shown an error related to the translation (CPhpMessageSource line 99, “$class=new ReflectionClass($moduleClass);”). This function doesn’t find “RightsModule”.

What version of the product are you using? On what operating system?

1.0.0 (the last one) with Yii 1.1.5

Please provide any additional information below.

I tried to do the same with the previous version of yii-rights (0.9.11) and it works fine (I included the spanish translation of version 1.0.0)."

Thank you!

@Andreu: Thanks for reporting the bug. To resolve this add the following to your application imports:




'application.modules.rights.*'



Thank you very much, good work

I worked on optimizing the RightsAuthManager as ignis55 suggested a while ago and I’ve managed to improve the performance of the permissions view by about 90% by implementing runtime caching for the items and the item children. I’m more than satisfied with the result, but I still have one idea on improving it I need to try out before it’s complete.

However, the optimized authorization manager will be available with the next release. If you wish to try it out you can always update to the latest revision.

Hi, after going through a lot of pain trying to set up srbac, I found the Rights module and I love it. It is so easy to install and use that it cannot get any easier. Thank you for this.

Just one thing, it seems that the Guest role is not assigned to non-logged users and I have to specify ‘defaultRoles’ => array(‘Guest’) to make it work, Is that correct behavior?

Hi,

This problem has been described early

Andrejs.

Andrejs: I read that, I was just curious if that is how it is supposed to be. The way I understand it ‘Guest’ role should be automatically assigned only to users that are not logged on and using defaultRoles assigns the ‘Guest’ role to everybody.

Hello Jan,

Thanks for the feedback, it’s much appreciated. About the default roles. In the current development version I have removed the support for configuring default roles for Rights (because it didn’t work as I thought it would). The correct way to configure your default roles is to set them for the authorization manager. I apologize for the confusion I’ve caused with the default roles.

As a side note I might add that Rights version 1.1 should be ready in a few days. I just need to do some final testing before I pack it. However, I can promise that it will be released before Christmas.

Version 1.1.0 is now available.

New features are:

  • 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

The documentation has also been updated and can be found at:

http://yii-rights.googlecode.com/files/yii-rights-doc-1.1.0.pdf

Merry Christmas to everyone!

Awesome! Merry Christmas. :)

I have download the demo but i think there is a problem with database creation.

I got this error


CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘blog.Rights’ doesn’t exist


I have created mySQl database by using blog-with-rights.sql.

Any idea ?

Thanks,

@amdawi: That’s my fault. I forgot to change the “AuthItemWeight” table name (should be “Rights”) in the blog schema I will correct this immediately. Sorry for the inconvenience.