[EXTENSION] Rights

Hi,

I’m still evaluating this great extension and noticed that the “generate items” feature, does not consider the folder where the controller is in.

For instance, if I have controller PostController (with action index,view) in folder .protected/controllers/admin, then the item generated are :

  • Post.Index
  • Post.View

…where it should be :

  • admin/Post.Index
  • admin/Post.View

Are my assumptions correct ? …Did anyone notice the same problem ?

ciao

I modified RGenerator to implement this feature, you can find it attacched to this comment

http://code.google.com/p/yii-rights/issues/detail?id=47#c6

hello chris

i am newbie in yii framework i like your extension rights

i installed it and working fine also

but there is one problem i am getting while its showing me authentication error but with and exception

i want to show only the message not the like an exception

attached the image check and tell me how can i solve it

thankx in advance

hello chris

i am newbie in yii framework i like your extension rights

i installed it and working fine also

but there is one problem i am getting while its showing me authentication error but with and exception

i want to show only the message not the like an exception

attached the image check and tell me how can i solve it

thankx in advance

This is a very nice extension!

I just have one question. I would like to be able to limit the number of actions a user can do. For example it is only allowed to post 3 news. I was thinking about a bizrule which would compare to numbers (Actual value < Limit). but that way I would have to save a many operations and it would be dificult to implement it in the code. Is there any easier way, maybe you have already a solution. It would also be very nice when I could assign a limit to a whole role…

Thank you for any solution and idea!

Hi NicoPli,

I think bizrule is the way to go.

You could write a helper class for this.


return MyAuthCheck::lessThanPostings(3)

Best regards,

schmunk

Cool … I’ll test it. Do you know if it will be part of the next release ?

Thanks

B)

Hello to all …

I wonder if there’s a way to give permission to manage the Rights module other than any Superusers? I’m doing a multi-level rights, where an AccountAdmin role should only be able to manage the rights/permissions of its own group of users/tasks, while the Superusers can manage rights/permissions across accounts, or global in scope.

Many thanks in advanced for any help.

Hi, Chris

Can Rights intaller import the four table with the type of MyISAM or without foreign keys?

When I reinstall the Rights , RInstaller throw an error in executing SQL: drop table if exists AuthItem.

I found that cause of the foreign key. But I have no idea about whether Rights works well without foreign keys. So I send this with my poor English expression.

yii-rights-doc-1.2.0.pdf

Is the red line a bug?

‘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.

[color="#FF0000"]‘install’=>true, // Whether to install rights. [/color]

‘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.

[color="#00FF00"]‘install’=>false, // Whether to enable installer. [/color]

‘debug’=>false, // Whether to enable debug mode.

),

Hello bro, i have a custom theme, named: ‘classic’. And i put all my view files under the theme/views/layouts/ directory. My theme is working fine with my application. But in your rights module, in RightsModule.php, public $appLayout = ‘application.views.layouts.main’; this line directs the application’s main layout file, but i want to add my themes main layout file instead. I added public $appLayout = ‘theme.views.layouts.main’; but i doesnt work for me. Please can you help me ? thanks.<tanim>

Hey bro how could i add my theme’s main layout file instead of, public $appLayout=(application.views.layouts.main) ? my theme is in themes/classic directory

Rights doesn’t work without the foreign keys because that’s how Yii’s built-in authorization manager, CDbAuthManager, works. I personally don’t like this implementation because in my experience foreign keys are not worth it, so I tend to avoid using them. In my opinion the software should take care of updating the database, not the database itself. Nevertheless, we’ll have to settle with Yii’s implementation for to time being.

One more thing… Why would you want to use MyISAM? :)

You can achieve this by configuring Rights appLayout to be following:


webroot.themes.classic.layouts.main

Many Many Thanks for your quick reply. :D

One thing brother, although it is not under this topics, but i posted it in related topics long time ago and found no proper solution. Can you please help me a little more ?

I have a table with column: question and answer, i want, when i hover mouse on question the associative answer will display. I did this:

<div id="question">

<?php echo CHtml::encode($data->getAttributeLabel(‘ques’)); ?>:

<?php echo CHtml::encode($data->ques); ?>

</div>

<div id="answer" style="display:none">

<?php echo CHtml::encode($data->getAttributeLabel(‘ans’)); ?>:

<?php echo CHtml::encode($data->ans); ?>

</div>

<?php

Yii::app()->clientScript->registerScript(‘show’, "

$(’#question’).hover(function(){

$(’#answer’).toggle();

});

");

?>

but it only toggles the first data, others are not showing. Please help me. Again Thanks alot. <tanim>

Maybe MyISAM is a little be faster than Innodb…

I created a new application with yii and installed rights with all modifications to main code but i still receive no such file directory error about User.php. I did change letters upper/lower but still :unsure:

what am i missing?

edit:fixed that. But now it seems i am just redirected back to index… >:(

Hello Chris,

I wanted to report a small bug in the latest version of Rights (or I am doing something wrong). I had "Authenticated" role, which had three children. Then, I changed its name to "Employee" and… those children was no longer connected with a new role. Also, AuthAssignment and AuthItem tables were updated, but AuthItemChild was not. Which is weird, because foreign key constraints should let you do this. What is even weirder, when I tried to change it in phpmyadmin (I mean, the value in AuthItemChild), it returned an error (I can duplicate it if you need).

Let me know if I am making a mistake somewhere or if you can duplicate it. It can also be a matter of MySQL version (5.5.11).

Hi Chris83,

what is the use of rights table? this table always empty on my app, what operation that can make right table not empty?

and for version 1.3.0 or maybe every versions, do I have to change


'authManager'=>array( 

			'class'=>'RDbAuthManager',

		),

to


'authManager'=>array( 

			'class'=>'RDbAuthManager',

                        'defaultRoles'=>'Guest',

		),

and change default filters and accessRules in every controllers that I made to


public function filters()

        {

                return array(

                        'rights',

                );

        }


public function allowedActions()

        {

                return 'index, view';

        }

thanks

Hi everyone, this is my first post…and I’m super duper newbie :)

anyway, i have five different type of roles in my application. i already install and make roles using rights extension. My problem is how i can show different menu for different roles…thanks before…:)