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

Yes. That was it. If so common do you think of "implementing" an error message such as "tables not found ensure that is right…etc" or try to locate the tables name case-insensitive.

Secondly, i was wondering if the User id is a string instead of a int will result in problems. I saw in database and everythiong was fine.

Now when i go to /index.php?r=srbac/authitem/assignments and select a user that i have assigned some roles i get nothing.

Friendly,

dimitris

Yes, I’ll add in version 1.1.1 because it’s a common problem

Nice.

Some thing else relevant to the srbac.

I was wondering how will it be to choose roles at the time you create a user while you use srbac.

We assume that the user has User management ( to be able to create user ) and ‘Authorizer’ ( to be able to assign role to user )roles.

For someone how wants to use the srbac it would be nice to be able to add a role to a user at the time he create the user ( with a drop down list to select from existing roles for example )

User sis from irc #yii prompt me to study how srbac do that and call ( i may say "play" ) with the same method within some of after/before Save/Update methods.

So here i am.

I will check t, but it will be wonderful if you can point me to key points.

Thanks once again,

Dimitris

Nice.

Some thing else, relevant to the srbac.

I was wondering how will it be to choose roles at the time you create a user while you use srbac.

We assume that the user has User management ( to be able to create user ) and ‘Authorizer’ ( to be able to assign role to user )roles.

For someone how wants to use the srbac it would be nice to be able to add a role to a user at the time he create the user ( with a drop down list to select from existing roles for example )

User sis from irc #yii prompt me to study how srbac do that and call ( i may say "play" ) with the same method within some of after/before Save/Update methods.

So here i am.

I will check t, but it will be wonderful if you can point me to key points.

Thanks once again,

Dimitris

This doesn’t have to do with srbac

You can create a listbox in your create user form and fill it with

Yii::app()->authManager->getRoles() that will return all roles from the database.

then in your user model




<?php

protected function afterSave() {

    $auth = Yii::app()->authManager;

     foreach ($_POST["roles"] as $role) {

        $auth->assign($role, $this->userid);

      }

  }

?>



Solved. Continue.

Something i haven’t understood yet. Even if i set the authorizations i have to edit accessRules in a models Controller to allow and not allow???

No, if you use RBAC you should delete the access rules and have your controllers extend SBaseController

I erased the accessRules method from the UserController.

My controller extends the controller which controller extends the CController.

I changed the Controller to extend the SBaseController.


class Controller extends SBaseController

I have created a View Details task with operations only View User and assigned to a User (xaris).

And when i login with xaris i can create users update etc. Thinks i should be able to.

I am able to use install in srbac and the debug is to true…if this help.

My config.php is like this.


'modules'=>array(

	        'srbac'=>array(

			'userid'=>'id',

                        'username'=>'username',

			'debug'=>true,

                        'imagesPack'=>'tango',

                        'iconText'=>true,




	        ),

	),

When debug is set to true the access check is overridden so any user can perform any action (even guest users)

[size="2"]SRBAC v1.1.1rc1 (rev195)[/size]

Changes:

1.Changed always allowed.Now the gui is always enabled and its’ array is merged with the one defined by alwaysAllowed attribute (which can be a string, array or file)

2.Added hungarian translation

3.Show always allowed actions in users assignments (fixes issue 53)

4.If checking db fails , check for lower-upper case issues and display a message(fixes issue 56)

5.Show message when exception occurs during install (fixes issue 54)

6.Fixed always allowed tab view beeing too short when there are not many controllers (fixes issue 50)

7.Added button to check for authItems not belonging to existing controllers (due to controller deletion etc) then select which authItems to delete.

8.Some bug fixes

Download and test :rolleyes:

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

Will download and test on Monday. :)

Hey ;)

Thanks for updates!

Lithuanian translation bellow:)

650

Lithuanian_srbac.php

Greetings,

CoLT

Is there a simple demo app that is integrated with srbac? For some reason I just don’t understand the way yii/srbac handles security, and the ability to download and tear apart an existing functional app would be tremendously helpful. Possibly modifying the blog demo to use srbac might be the best option.

Thoughts?

That’s a good idea.

I’ll add a demo example along with the srbac final 1.1.1 release.

I don’t know if there’s a blog demo download. If there is you can download it, install srbac , change the controllers so they extend SBaseController and you’re ready to go

Does the "userclass" typically extend "CUserIdentity" or are they usually two separate classes?

user class is the name of your application’s Users class. It’s not included in srbac

I am getting an error running on PHP 5.1.6 using SRBAC 1.1.1 dev.

The language is set to norwegian in my yii main.php configuration.

Is this problem solved in the latest RC1?




Object of class CMissingTranslationEvent to string conversion


#0 /framework/yii-1.1.1.r1907/framework/base/CComponent.php(529): call_user_func()

#1 /framework/yii-1.1.1.r1907/framework/i18n/CMessageSource.php(117): CPhpMessageSource->raiseEvent()

#2 /framework/yii-1.1.1.r1907/framework/i18n/CMessageSource.php(101): CPhpMessageSource->onMissingTranslation()

#3 /framework/yii-1.1.1.r1907/framework/i18n/CMessageSource.php(77): CPhpMessageSource->translateMessage()

#4 /www/backend/protected/modules/srbac/components/Helper.php(370): CPhpMessageSource->translate()

#5 /www/backend/protected/modules/srbac/views/authitem/frontpage.php(22): translate()

#6 /framework/yii-1.1.1.r1907/framework/web/CBaseController.php(119): require()

#7 /framework/yii-1.1.1.r1907/framework/web/CBaseController.php(88): AuthitemController->renderInternal()

#8 /framework/yii-1.1.1.r1907/framework/web/CController.php(742): AuthitemController->renderFile()

#9 /framework/yii-1.1.1.r1907/framework/web/CController.php(681): AuthitemController->renderPartial()



Which version of Yii do you use?

Srbac 1.1.1rc2 available with a minor enhancement of auto detecting actions that belong to the controller’s actions function (captchas etc)

Also the blog demo with srbac is available in the extensions page

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