[EXTENSION] srbac : Web interface for the administration of rbac

Hi spyros

i have one doubt

in gmail login when we click Stay signed in checkbox once and when we open gmail page it automatically checked it.

i want to do same in yii

i gave

$duration=$form->rememberme ? 36002430 : 0; // 30 days

Yii::app()->user->login($identity,$duration);

then

how to auto check when once that check box checked

Beta 4/5 persistent bug:

AuthItemController.php has undefined variables: ‘active’ & ‘message’ (near 147).

Though ‘message’ is defined since beta 5, variable with the same name is still not passed to renderPartial() in TaskToRole.php, roleToUser.php, operationToTask.php.

For the first time the bug was reported at http://www.yiiframework.com/extension/srbac/reviews/#c516

I would also like to point out, that code without E_NOTICEs would be very nice!

Hi,

Most of the things discussed here are probably fixed in version 1.00

http://www.yiiframework.com/extension/srbac/

Enhancements:

Srbac can be installed as a child module too

Custom cssFile support

Bug fixes:

Fixed undefined variables (thanks to sebi, idle sign)

Fixed possible SQL-injections flaw (thanks to Anticon)

Fixed jquery requested twice (thanks to horizons)

Use Yii:app()->getRequest() instead of $_REQUEST (thanks to horizons)

About the license file do you need something specific? Isn’t the one in the extensions page ok?

If you find any errors please let me know

  1. Seems to me, that’s a high time to think about UI translations.

Currently ‘sourceLanguage’=>‘ru’ or ‘el_gr’ or something else gives us nothing but built-in English UI.

Nevertheless see russian messages in attachment (based on ‘el_gr’ messages file from 1.00).

  1. Frontpage wanted with manage and list links.

  2. I think, the idea to address authitems by names in db tables is not as good as it seems, personally I’d rather like to have ‘id’ primary key and ‘name’ unique key in items table. In that way we can make item renaming easier and even save some hdd space :).

Besides ‘alias’ field could be useful. That’s when we scan through the authitems list we see ‘alias’ (meaningful user friendly name, probably in native language) and ‘name’ (the name we use in script, probably in English).

This one is fine, nevermind.

  1. I’ll try the russian translation. The greek translation doesn’t work for you?

2.Yes, that’s true

3.That’s the way Yii authManager handles the auth items. I think renaming works ok as it is now, about the alias i’ll try to add a column and hope I wont break anything in AuthManager’s code

Why don’t you use the translation module for user friendly names?

You wouldn’t even have to touch the database to rename items 8)

True, but I guess you wouldn’t be able to provide names for the application source language if you did that (because no translation will be done if source language == requested language). But you could use translations for the item description.

Nope :huh:

Alias column, as I see it, just can’t brake anything in AuthManager, if only we use it in srbac’s administration UI solely for user convinience.

Translations for authItems names which are given by user, do you mean?

Hm, really it’s not the case to use translation module for dynamic data.

This morning I was blessed with yet another crazy idea:

If srbac has an option to create authItems automatically from existing application controllers, it would be helpful. E.g. we say to srbac: create authItems for actions in controller ‘Article’, it creates operations from given actions (‘Create Article’, ‘Edit Article’ etc.) and a task (‘Manage Article’), then automatically assigns these operations to this task. That’s the basic idea. If we step even further srbac could form accessRules() function for a given controller.

Ok, if your authData is highly dynamic it’s not a good idea. In my case it’s more or less static.

Funny. I also planed to implement this in my project. ^^

Mapping actions to operations, controllers to tasks and maybe modules to roles.

If this extension could do that, I wouldn’t have to do it on my own. :)

I’ve attached the translated messages to spanish for Srbac v.1.0.0. 300

es_es.tar.gz

I hope everyone enjoy.

Spyros, Thanks for thaat excellent extension. It’s simply gr8.

Note:

  • Uncompress the file into modules/srbac/messages folder

  • Rename the folder: "es_es" to "es"

  • Add “‘language’=>‘es’,” in your config file (main.php)

And that’s all, everything will work like a charm

I have already implemented the use of custom layout for srbac and the ajax loading indicators.

I will try the automatic creation of operations/tasks from controllers/actions and let you know

The Russian translation is working (I think)

The spanish file is corrupted.Please send it again as a zip or rar file.

Right you are judging by this screenshot, but on my test app neither ‘sourceLanguage’=>‘ru’ nor ‘language’=>‘ru’ helps.

Sure, Here it is again. Now in Zip format.

303

es.zip

Hi, Spyros

While creating a user, i need to assign the role for this user, right from the user creation _form. I tried to populate a dropdownlist with AuthItem values, using AuthItem::model()->findAll($criteria), but did not manage to get it working. How can i access this model from the srbac module?

By the way, thanks for this great module.

I just put this in my main config file




return array(

  'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',

  'language'=>'ru',

....



and it works

Also the spanish translation is working

There is also one more file for translation, the

views/install/installText.php

for the installation translation

Have you put a

Yii::import(‘application.modules.srbac.models.AuthItem’);

before you call the AuthItem::model()->findAll($criteria)