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

Hi, Spyros,

Please check srbac issues at Google Code, there’s something for you :)

  1. You are right about the version, it’s a bit confusing (I guess I was in a hurry when i upload it)

Next version will be 1.2.commitNum and release 1.3 and so on

2.Thanks for the pack and for the time you dedicated for srbac.

I haven’t notice the table rendering program in IE.

I will add each set of icons as an optional pack

Hi Spyros,

I am currently working on translations in my PiiModule.

Just for the case you haven’t noticed it yet:

http://www.yiiframework.com/doc/api/1.0.10/CPhpMessageSource

Best regards,

schmunk

[edit: double post]

Yes I have noticed it.

The problem is that using Yii:t() breaks compatibility with versions < 1.0.10

Currently in svn code I have modified the code to use my own function for translation that checks the version and uses the old module based or the new Yii based translation.

I guess after a while when I make srbac 1.1 compatible I will drop the old module based translation.

srbac 1.0.3 beta available in googlecode

http://code.google.com/p/srbac/downloads/list

Bug Fixes:

  • Added a default unauthorized view in case the user has not defined one

  • Fixed an IE bug in autocreation view (Thanks to idle sign).

  • Access is now always denied to guests, except if the current page is in alwaysAllowed array

Enhancements:

  • Added imagesPack attribute.User can choose which pack of images to use for the srbac icons. Currently there are two packs available (tango and noia).A user can use a custom set of icons by defining eg $imagesPath = “images” , $imagesPack=“myPack” and putting the icons in webroot/images/myPack.The icons’ names must be the same as in noia and tango packs.

  • Hovering over an authItem in authItems manager will show its description

  • If an action is in alwaysAllowed array will be ignored during the autocreation of authItems

Updates:

  • Added new icons (tango pack) and a control center top bar (Thanks to idle sign).

  • Added new css styles and new ajax-loader (thanks to idle sign)

  • Update of spanish messages (thanks to Ricardo Obregón).

  • Added noia icons pack

  • Changed custom images path relative to webroot

  • Set default css to srbac.css

  • Changed allowedAccess() method in SBaseController to protected so it can be inherited

From now on all versions of srbac will be in 1.0.x for Yii 1.0.x versions.

The Yii 1.1 compatible versions of srbac will be 1.1.x when the stable version of Yii 1.1 will be released

Hi, Spyros,

I believe those icons at top control bar and at manage page should really go with titles. The idea a propose so (and made it in Recharge #1) is that we have a plenty of space, and could bravely add those titles to impove user experience. By now the icons are just not enough self-descriptive, I think.

What would you say? I suppose we can have a poll here?

Hello Spyros,

I’ve downloaded the last SVN from Google Code and already updated the spanish translation.

Nevertheless, I’ve found some problems on Linux platforms.

Here is the error message and stack trace.




PHP Error

Description


include(srbac.php): failed to open stream: No such file or directory

Source Code:


/home/laptop/svn/yii-current/framework/YiiBase.php(337)


00325:      * @param string class name

00326:      * @return boolean whether the class has been loaded successfully

00327:      */

00328:     public static function autoload($className)

00329:     {

00330:         // use include so that the error PHP file may appear

00331:         if(isset(self::$_coreClasses[$className]))

00332:             include(YII_PATH.self::$_coreClasses[$className]);

00333:         else if(isset(self::$_classes[$className]))

00334:             include(self::$_classes[$className]);

00335:         else

00336:         {

00337: include($className.'.php');

00338:             return class_exists($className,false) || interface_exists($className,false);

00339:         }

00340:         return true;

00341:     }

00342: 


Stack Trace


#0 /home/laptop/svn/yii-current/framework/YiiBase.php(337): autoload()

#1 unknown(0): autoload()

#2 unknown(0): spl_autoload_call()

#3 /home/laptop/svn/yii-current/framework/i18n/CPhpMessageSource.php(99): ReflectionClass->__construct()

#4 /home/laptop/svn/yii-current/framework/i18n/CPhpMessageSource.php(116): CPhpMessageSource->getMessageFile()

#5 /home/laptop/svn/yii-current/framework/i18n/CMessageSource.php(95): CPhpMessageSource->loadMessages()

#6 /home/laptop/svn/yii-current/framework/i18n/CMessageSource.php(77): CPhpMessageSource->translateMessage()

#7 /home/laptop/svn/yii-current/framework/YiiBase.php(478): CPhpMessageSource->translate()

#8 /home/laptop/projects/mysite/protected/modules/srbac/components/Helper.php(341): t()

#9 /home/laptop/projects/mysite/protected/modules/srbac/views/authitem/frontpage.php(5): translate()

#10 /home/laptop/svn/yii-current/framework/web/CBaseController.php(119): require()

#11 /home/laptop/svn/yii-current/framework/web/CBaseController.php(88): AuthitemController->renderInternal()

#12 /home/laptop/svn/yii-current/framework/web/CController.php(706): AuthitemController->renderFile()

#13 /home/laptop/projects/mysite/protected/modules/srbac/views/authitem/assign.php(3): AuthitemController->renderPartial()

#14 /home/laptop/svn/yii-current/framework/web/CBaseController.php(119): require()




I’ve not checked out the new source code, I’m doing that right now. I’ll notify you if I found a fix.

Greetings,

Ricardo

Are you using 1.0.10

There’s a bug in CPhpMessageSource I have posted in bugs forum

line 97 should be

$moduleClass=substr($category,0,$pos)."Module";

instead of

$moduleClass=substr($category,0,$pos);

I personaly prefer icons without messages so I’ll make it an option so everyone can be happy :)

I personaly prefer icons without messages so I’ll make it an option so everyone can be happy :)

In fact, I’m using Yii 1.0.11-dev (downloaded from svn on 2009-10-25)

I’ll check the whole code and tell you about.

I agree. Because I like icons without messages. Nevertheless, a title property in "a" tag is good idea.

I’ve made the fix in CPhpMessageSource file, and got a working Srbac module. Tested and averything is working ok.

I like to recommend below change in frontpage view file:




<div class="marginBottom">

  <div class="iconSet"><!-- I added this line -->

    <div class="iconBox">

    <?php echo CHtml::link(

            CHtml::image($this->module->getIconsPath().'/manageAuth.png',

                    Helper::translate('srbac','Managing auth items'),

                    array('class'=>'icon',

                      'title'=>Helper::translate('srbac','Managing auth items'),

                      'border'=>0

                      )

                ),

            array('authitem/manage/manage'))

    ?>

    </div>

    <div class="iconBox">

    <?php echo CHtml::link(

            CHtml::image($this->module->getIconsPath().'/usersAssign.png',

                    Helper::translate('srbac','Assign to users'),

                    array('class'=>'icon',

                      'title'=>Helper::translate('srbac','Assign to users'),

                      'border'=>0,

                      )

                ),

            array('authitem/assign'));?>

    </div>

    <div class="iconBox">

    <?php echo CHtml::link(

            CHtml::image($this->module->getIconsPath().'/users.png',

                    Helper::translate('srbac','User\'s assignments'),

                    array('class'=>'icon',

                      'title'=>Helper::translate('srbac','User\'s assignments'),

                      'border'=>0

                      )

                ),

            array('authitem/assignments'));?>

    </div>

  </div><!-- And also this line -->

  <div class="reset"></div>

</div>



This change is useful because in my particular case I like to set “float: left” or “float: right” in .iconBox CSS style (It looks like a toolbar). That way the whole module graphic design won’t be affected and those buttons can be customized as anyone wants.

iconSet class in css and iconText attribute are commited in r50.

Please checkout and check ;)

Great, looks very nice.

I like the showText attribute. B)

Hello Spyros,

I have another recommendation. This is for make an easier administration.

When assigning Roles, Tasks or operations, the list should be ordered alphabetically. I think that It is more comfortable and easier to find an user/role/task/operation when there are many of them.

Ricardo

Yes, you are right.

I’ll add it in final 1.0.3

In the next week I will release version 1.0.3 so if anyone has to contribute an updated translation it would be ver y appreciated

Thanks

Very good news. The last SVN version is working great.

Spanish translation is already updated in GCode.

Ricardo

I have some problems assigning tasks, roles, and operations in the sense that i can’t add nor remove items.

  • For fixing the roles-to-user and operations-to-task (first and third tab) assigments I have to uncomment two "//ver 1.1" comments inside controllers/AuthitemController.php.

  • For fixing the tasks-to-role assigment (the second tab) I noticed that two variables overlap:

$_POST[‘AuthItem’][‘name’][‘assign’] and $_POST[‘AuthItem’][‘name’]

This, again, is because I had to uncomment the line that says "//ver 1.1"

Has anyone already encountered this issue?

I’m using an ubuntu box as server with Apache/2.2.3 and PHP 5.2.0-8+etch15. I tried this with Firefox (with both Windows and Ubuntu) and Internet Explorer.