Yii Framework Forum: [EXTENSION] srbac : Web interface for the administration of rbac - Yii Framework Forum

Jump to content

  • (38 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] srbac : Web interface for the administration of rbac Rate Topic: ****- 7 Votes

#1 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 05 July 2009 - 11:48 AM

Srbac is a module that adds a graphic web interface for the administration of Yii rbac
It uses the  CDbAuthManager so it needs a database (MySQL and SQlite are tested)
In this first alpha version you can do:
Create, update and delete Auth items (roles, tasks, operations)
Assign operations to tasks, tasks to roles and roles to users.
You can't yet assign operations to users, tasks to operations etc.
Demo http://spyros.agilit...authItem/assign
Extension http://www.yiiframew...xtension/srbac/


2

#2 User is offline   icevan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 18-June 09
  • Location:Russia

Posted 13 July 2009 - 01:08 AM

http://spyros.agilit...authItem/assign

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 19 columns parent, child are not unique

/home/www/spyros.agilityhoster.com/yii/framework/db/CDbCommand.php(211)
0

#3 User is offline   KMD 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 06-May 09

Posted 13 July 2009 - 03:35 AM

// Your application's user class (default: User)
"userclass"=>"User",

How to configure this? Do I need to create a user class?
0

#4 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 13 July 2009 - 03:45 AM

Quote

// Your application's user class (default: User)

"userclass"=>"User",



How to configure this? Do I need to create a user class?

Yes , you must have a user class if you want to use the extension

0

#5 User is offline   icevan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 18-June 09
  • Location:Russia

Posted 14 July 2009 - 01:00 AM

It's a very alpha version.
Dear creator, do u have a plan  for  next release?
I need  to know  create my own interface, modify SRbac extension or wait  some days for new version.
0

#6 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 14 July 2009 - 03:08 AM

The releases depend on user's feedback.
If anyone finds bugs that need to be fixed, or has an idea to add, it will be implemented asap.
Is this release stable enough to become the version 1?
Do you want something to be added?

Thanks for your interest
0

#7 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 14 July 2009 - 04:11 AM

Quote

Hello. I trying to use srbac. But, after configuration of authManager and srbac, my browser cannot retrieve url "index.php?r=srbac/authItem/install" with message "Page not found". What's the problem?

Have you added the srbac module in you config file

<?php
'modules'=>array('srbac'=>
  array(
  // Your application's user class (default: User)
  "userclass"=>"User",
  // Your users' table user_id column (default: userid)
  "userid"=>"user_ID",
  // your users' table username column (default: username)
  "username"=>"username",
  // If in debug mode (default: false)
  "debug"=>true,
  // The number of items shown in each page (default:15)
  "pageSize"=>10,
  )
  ),
?>
[code]

0

#8 User is offline   Demyan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 10-July 09
  • Location:Russian Federation

Posted 14 July 2009 - 04:24 AM

After i navigate my browser to the "index.php?r=srbac/authItem/install" url, i recieve the error message "Undefined index: action" in the line

$action = $_POST['action'];

of the acionInstall() method of the AuthItemController class.
Can you help me to resolve this problem?
0

#9 User is offline   Demyan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 10-July 09
  • Location:Russian Federation

Posted 14 July 2009 - 04:33 AM

Quote

Quote

Hello. I trying to use srbac. But, after configuration of authManager and srbac, my browser cannot retrieve url "index.php?r=srbac/authItem/install" with message "Page not found". What's the problem?


Have you added the srbac module in you config file


<?php
'modules'=>array('srbac'=>
  array(
  // Your application's user class (default: User)
  "userclass"=>"User",
  // Your users' table user_id column (default: userid)
  "userid"=>"user_ID",
  // your users' table username column (default: username)
  "username"=>"username",
  // If in debug mode (default: false)
  "debug"=>true,
  // The number of items shown in each page (default:15)
  "pageSize"=>10,
  )
  ),
?>
[code]


This problem reason was wrong directory of srbac. Browser really couldn't find this path :)

Yes, i have added srbac in the main config file of the application to the 'modules' section.
0

#10 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 14 July 2009 - 04:44 AM

probably you have
error_reporting  =  E_ALL
in your php ini
You may overide it by changing it to
error_reporting  =  E_ALL & ~E_NOTICE
or wait until I fix this issues (update should be up tonight)
0

#11 User is offline   Demyan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 10-July 09
  • Location:Russian Federation

Posted 14 July 2009 - 04:51 AM

Thanks for your fast reply.
0

#12 User is offline   icevan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 18-June 09
  • Location:Russia

Posted 14 July 2009 - 05:10 AM

Yes  i do all by instructions.
But i see massive of  warnings and errors when try open page assign page.
Also for install i do some changes  in the code for detemine variables, because install.php did not  know vars $error and $disabled. After installation i see test data on default page index.php?r=srbac/authItem/ , page  work normaly.
Then i try page index.php?r=srbac/authItem/assign and look on many errors  about Post['action'] and about var's based on it and other POST data.

For fix it i do next with AuthItemController:
add under line 84 
$userid = '';
$active = "tab1";
$message = "";

add after block //Init values finished:

if(Yii::app()->request->isPostRequest){
$userid = $_POST[Yii::app()->getModule('srbac')->userclass][$this->module->userid];
}

After this  actions page /index.php?r=srbac/authItem/assign work and  show  me tab's.

On trying  use the buttons '>>>' and '<<<', on any tab,  i catch the Fatal error:
Undefined index: User    AuthItemController.php(105)

After  this i write  the  my first today msg. in this  thread  and  back to real application.
Now i go to home  and do test this ext. on full clean yii 1.07 w/o something
If it will work fine i will search the bug.

I hope  on Your help Spyros.

This ext. is very usefull, if  u need help i'm ready for action. Anywhere  i will construct interface for manage  RBAC. may be  based  on this ext, may be not.

Wait Your reply.


0

#13 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 14 July 2009 - 05:43 AM

The extensions was developed with
error_reporting  =  E_ALL & ~E_NOTICE
in the php.ini (my fault) so I saw no errors while developing
I will fix the errors in the next release
0

#14 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 14 July 2009 - 06:03 AM

This is a very quick fix for the warnings.
Use this and tell me if there are still any problems

Attached File(s)


0

#15 User is offline   icevan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 18-June 09
  • Location:Russia

Posted 14 July 2009 - 07:56 AM

Thank for fix.
Quick fix work fine. @.
I do  some  tests for    assign and  deassign users, roles and  tasks.
and found some interface bugs.
I did next:
First
When open the ?r=srbac/authItem/assign i see all assigned items in the Assigned control (middle select on each tab)

Second
Does not see caution message  when press the <<< or >>>
when wrong selection.

Third
-select role or task tab
-select item in Assigned control
-press <<< or >>>
interface move  to users tab


0

#16 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 14 July 2009 - 10:03 AM

Thanks, I'll fix those too in the update
0

#17 User is offline   icevan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 18-June 09
  • Location:Russia

Posted 14 July 2009 - 11:39 PM

Today i fill the RBAC mdodel over You ext. with quick fix.

I think  extension  need  the tabled input methods or import methods for write  many AuthItems. Also  a model in CVS files look more readiable.


For very far future: very nice will add a graphical interface  :-)
0

#18 User is offline   icevan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 18-June 09
  • Location:Russia

Posted 14 July 2009 - 11:50 PM

Found a bug.
- open srbac/authItem/admin
- click Update action on  any AuthItem from list
- Change Name field
- Save
----- Catch a error message 'The requested page does not exist.'
0

#19 User is offline   Spyros 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 461
  • Joined: 14-April 09
  • Location:Athens - Greece

Posted 15 July 2009 - 02:53 AM

This is because the name is the primary key so you should not change it.
I 'll look if there's a way to safely change the name of any item
0

#20 User is offline   icevan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 18-June 09
  • Location:Russia

Posted 16 July 2009 - 02:04 AM

I think need update base tables with fields type INT4  with AUTO_INCREMET,
in my case  SERIAL (I'm use Postgres).
And setup interface for use  its fields

0

Share this topic:


  • (38 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users