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

Hi Spyros,

One thing that should be fixed: in http://www.yiiframework.com/extension/srbac/ on the “Documentation” tab, it says SRBAC requires Yii 1.0.6 or better. Actually since you have used ‘safe’ validation rule in models/AuthItem.php ll. 46-48, SRBAC requires Yii 1.1. Documentation of declaring ‘safe’ attributes is here http://www.yiiframework.com/doc/guide/form.model#securing-attribute-assignments. ‘safe’ rule only comes in 1.1+. Yii 1.0.x uses SafeAttributes(). I am on 1.0.9 so I will fix my copy of SRBAC; but is there a way to make SRBAC work with 1.0x and 1.1x ?

  • Jeremy

Srbac currently works with 1.0.6 + and not 1.1 (1.1. is still in alpha)

The safe rules are remains of an attempt to check 1.1 compatibility , you should removed them like this




 public function rules() {

    return array(

    array('name','length','max'=>64),

    array('name, type', 'required'),

    array('type', 'numerical', 'integerOnly'=>true),

    );

  }



You can get a corrected copy of the file here

http://code.google.com/p/srbac/source/browse/trunk/protected/modules/srbac/models/AuthItem.php

Thanks

Hi. First at all I want to thank you for such nice extension. It’s really very useful!

Now I have 2 questions:

  1. How can I administrate the access to the srbac module? Assign it to specific roles.

  2. What about access to modules? I have created a module, and then create a model and crud for that module. Now, how can I specify the tasks and operations for that, and assign it to specific roles?

Thanks!

  1. Access to srbac has only the Authority role (You can assign this role to the users that will administrate srbac)

  2. The auto creation tool for operations/tasks and access checking works currently only for the controllers in the default controller path.I will fix that in the next version so this will work with modules too.

The other way is to add manually the checks for every action

  1. Oh… I’ve set the superUser -to-> admin , but I can administrate the srbac as Guest. As I understood from documentation, I must set debug var to false to make Guest users not to have access to srbac. But when I set up my debug variable to false, and after that try to access srbac page, I get the error: “Property “CAttributeCollection.debug” is not defined.”

  2. Ok, thx. I will probably wait for the next releases. Actually at that moment I’m not so familiar with Yii’s RBAC… Some things are not pretty clear. But I think I just must to use it for a time, to understand completely to 100% how does it work :)

  1. Could you paste the exactly stack trace of the error?

Sure.

Patison - I had a similar problem with ‘debug’. are you using 1.02.06 version that Spyros posted in this forum? It removes the assumption that there is a yii-app-debug property.

Spyros - another feature request for next version: Please add a configuration to SRBAC that controls the number of lines in the three-tab assignment view. 6 lines is too small for my purposes - I have LOTS of controllers, operations, roles, and users. I’ve changed the hard-coded ‘6’ to ‘15’ in all the views, but it would be nicer to have this configurable.

Yes , this must be the Yii::app()->params->debug variable

Just remove it

I’ll add the number of line parameter in the next version

Nope. This last release was posted just yesterday. I’ve download the extension few days ago. So I’m using actually 1_02_5 version. :)

I’ve download now the last release. Installed it. And there appeared some problems…

When a click on the Manage link, it links to /srbac/authitem/manage/manage (instead of /srbac/authItem/manage/manage), so I have the 404 error.

Exactly the same thing with all other administration links… :(

Spyros - another small issue to correct in next version:

In modules/srbac/views/AuthItem/userAssignments.php, there are (3) instances of


<? } ?>

In my php.ini I have


short_open_tag = Off

so this must be changed to


<?php } ?>

Thanks!

Due to case sensitivity in some linux OS i changed all authItem paths to authitem.

If you find any link to authItem let me know

I understood. But I just can’t use new paths with authitem. I’m getting the 404 Page Not Found error. How can I fix it, to use new URLs with a lower case authitem ?

if your directory is authItem rename it to authitem

What OS are you using?

I’m using Linux(Ubuntu). What folder exactly should I rename?

I placed the module to modules/srbac …

The folder

modules/srbac/views/authItem =>modules/srbac/views/authitem

The above issues are fixed

You can get the update from

http://code.google.com/p/srbac/source/checkout

until I upload the new version

I’ve renamed it as you said, but nothing happens. Still get 404 error … - “Unable to resolve the request “srbac/authitem”.”

Please check if this happens with the following attachment