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

Jump to content

  • (38 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 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

#21 User is offline   Spyros 

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

Posted 16 July 2009 - 02:38 AM

The db is used internally by Yii authManager so you can't change it
0

#22 User is offline   icevan 

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

Posted 16 July 2009 - 10:44 PM

What do u mean?
Yii is  only interpritate logik  and  use  data  strored in its 3 tables.
If  add column srbac_id in each table,  it give
0

#23 User is offline   Spyros 

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

Posted 17 July 2009 - 12:12 AM

I am not sure that CDbAuthManager will work correctly if you change the structure of the 3 tables it uses.

0

#24 User is offline   Spyros 

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

Posted 23 July 2009 - 01:08 AM

Updated the extension to srbac beta with the following changes

Bug Fixes:
  • Fixed udefined variable errors
  • Fixed showing all items in the assigned and in the not assigned panels when accessing the
    assign page for the first time
  • Fixed errors when pressing '<<' or '>>' with a wrong selection of items
  • Wrong tab display after an assignment

Enhancements:
  • You can select if demo data will be created in install
  • All assignments calls are made in ajax
  • You can set the name of the Authorizer authItem
  • You can update the names of the auth Items


Demo
Srbac Extension
1

#25 User is offline   Spyros 

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

Posted 27 July 2009 - 07:15 AM

Updated the extension to srbac beta2 with the following changes

Enhancements:
  • You can delete auth items
  • New ajax driven web interface for the administration of auth items


Demo
Srbac Extension
0

#26 User is offline   Ben 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 266
  • Joined: 15-March 09

Posted 27 July 2009 - 07:49 AM

Looks nice. Maybe I'll give it a try with my next project. :)

But what I'm missing is a view, that shows which user can perform which operations. Currently one can only click user by user to see what roles are assigned to them. Then one can switch the tab and have a look at the roles - one by one - to see what tasks are assigned. This repeats for the operations.
Alltogether, this is convenient for assigning authItems to each other, but not to get an impression of who is allowed to perfom which action. Is this something you plan to add in a future release?
Don't like ads in my sig...
0

#27 User is offline   Spyros 

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

Posted 27 July 2009 - 11:48 AM

Yes a tree view with the assigned items of each user is planned for the next release
0

#28 User is offline   Spyros 

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

Posted 29 July 2009 - 12:42 AM

Update beta 3
Enhancements:
View Roles / Tasks / Operations assigned to users
Demo
0

#29 User is offline   icevan 

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

Posted 29 July 2009 - 04:23 AM

Nice to see progress. Thank you for this job :-)
PHP Ice Monster
0

#30 User is offline   Ben 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 266
  • Joined: 15-March 09

Posted 29 July 2009 - 05:41 PM

Definitely. :)

Looks good with all browser I have installed( FF3.5, IE8, Safari3.1.1, Chrome 2.0), except Opera 9.6.4. See screenshot.

Attached File  EXTENSION_srbac.PNG (44.75K)
Number of downloads: 115
Don't like ads in my sig...
0

#31 User is offline   Spyros 

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

Posted 30 July 2009 - 12:09 AM

View PostBen, on 29 July 2009 - 05:41 PM, said:

Definitely. :)

Looks good with all browser I have installed( FF3.5, IE8, Safari3.1.1, Chrome 2.0), except Opera 9.6.4. See screenshot.

Attachment EXTENSION_srbac.PNG


Please could you try the fixed I attached with Opera?

Attached File(s)


0

#32 User is offline   Ben 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 266
  • Joined: 15-March 09

Posted 30 July 2009 - 05:57 AM

Looks much better now. There is still a small difference between Opera and the other browsers: Opera seems to begin the table that contains the operations in a new line, which causes a bit space right above the table which isn't shown in other browsers. But I don't think this is (nor do I think it might become) a problem. So thanks for the quick fix. :)

Some other things I came across while installing the module (hooray, now I know how to work with modules!):
1) Need for CDbAuthManager. Shouldn't this module work with all the authManagers? It displays, creates and administrates authItems, I think this should be possible with every implementation of IAuthManager.
2) Related to the first point; Need for user class being an CActiveRecord. I fell over this in the view that displays the assignments. It calls findAll() to get the list of users. Although I have to admit that I have no clue how this could be solved properly, I think it might raise the reusability of the module if you could provide a more generic way to get the users list. I didn't find something like an IUserManager that would be able to provide the needed methods, but maybe I'm missing something.
3) The tasks shown in the attachement (except the manageUsers task) are actually operations assigned to the role "admin". I know you currently only support role to user, task to role and operation to task, but I think this can be filtered.

All good things come in threes, so I guess this is enough for now and keeps you busy. ;)

Keep up good work, I really like this module and think it is a mandatory that can be usefull for nearly every web application!

Fixed layout in Opera:
Attached File  EXTENSION_srbac_fixed.PNG (41.59K)
Number of downloads: 77
Don't like ads in my sig...
0

#33 User is offline   Anticon 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 25-February 09
  • Location:Germany

Posted 13 August 2009 - 07:08 AM

I' ve found a small error. If SRBAC is not in debugmode, I get following error, when a not-Authorizer-user tries to access SRBAC:
2009/08/13 13:47:55 [error] [system.db.CDbCommand] Error in querying SQL: SELECT * FROM `assignments` WHERE itemname = Authorizer LIMIT 1
2009/08/13 13:47:55 [error] [exception.CDbException] exception 'CDbException' with message 'CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Authorizer' in 'where clause'' in C:\xxxxxxxx\yii108\framework\db\CDbCommand.php:322


After changing line 173 of helper.php into
$criteria->condition = "itemname = '".Yii::app()->getModule('srbac')->superUser."'";

I get the normal "Unauthorized"-message.

Greetings
Carsten
0

#34 User is offline   sebi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 06-October 08

Posted 14 August 2009 - 11:15 AM

Ok, after I press "Install"
I get the message to overwrite srbac, which is fine.
If I click on "Overwrite", I got this errorMessage:



Install Srbac
Error while installing srbac.
Please check your database and try again



whats going wrong there?
If it helps, after this steps I can only see items table in my database.
0

#35 User is offline   rabol 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 50
  • Joined: 08-October 08

Posted 15 August 2009 - 06:45 AM

When I try to start the installation it keeps telling me that the AuthManager is not installed.

I can login so it's installed :)

As far as I can see a Exception is thrown due to missing "CDbAuthManager.superUser is not defined."

Running on Win Vista and IIS7, Yii v1.08
0

#36 User is offline   sebi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 06-October 08

Posted 15 August 2009 - 06:48 AM

@rabol it is a problem in the Documentation, superUser should be in the srbac module array, instead of the authManager array.

Anyone have a clue about my Problem above?
0

#37 User is offline   rabol 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 50
  • Joined: 08-October 08

Posted 15 August 2009 - 07:08 AM

View Postsebi, on 15 August 2009 - 06:48 AM, said:

@rabol it is a problem in the Documentation, superUser should be in the srbac module array, instead of the authManager array.

Anyone have a clue about my Problem above?



Thanks sebi!

After correcting that I get the same error as you :)

It's a SQL error, if you add var_dump($ex) in the catch { at line 285 of srbac/components/Helper.php you can see this;

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1217 Cannot delete or update a parent row: a foreign key constraint fails"

I'll try to find a solution and let you know.
0

#38 User is offline   rabol 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 50
  • Joined: 08-October 08

Posted 15 August 2009 - 07:21 AM

View Postrabol, on 15 August 2009 - 07:08 AM, said:

Thanks sebi!

After correcting that I get the same error as you :)

It's a SQL error, if you add var_dump($ex) in the catch { at line 285 of srbac/components/Helper.php you can see this;

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1217 Cannot delete or update a parent row: a foreign key constraint fails"

I'll try to find a solution and let you know.



The problem is that the installation procedure don't delete existing tables in the correct order:
the correct order is:

$db->createCommand("drop table if exists ".$assignmentTable.";")->execute();
$db->createCommand("drop table if exists ".$itemChildTable.";")->execute();
$db->createCommand("drop table if exists ".$itemTable.";")->execute();

in line 226 of the /modules/srbac/components/Helper.php
0

#39 User is offline   rabol 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 50
  • Joined: 08-October 08

Posted 15 August 2009 - 07:38 AM

Have in mind that this extension will not work with error_reporting(E_ALL) as it uses several uninitialized variables, the developer must be a young guy :) :) :)
0

#40 User is offline   sebi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 65
  • Joined: 06-October 08

Posted 15 August 2009 - 09:36 AM

Jap, still doesn't work for me with the same errormessage above.
I think there are also other Problem(s)?
0

Share this topic:


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

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

  1. jfb