This extension is an alternate role based access control system for the Yii. It meant to be more tied to the MVC in that sense that each permission is closely related to controller/action pair and access checking is being performed in controller filters.
It also features an yiic shell command which will allow you to fully manipulate permissions and roles, e.g. create/update/grant and revoke, search, etc.
At present this extension is in early stage and was only tested with MySQL 5 database
There is a small description available here: http://www.yiiframework.com/forum/index.php/topic,905.0.html
All comments, bug reports and suggestions are welcome.
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.0 or above
- MySQL 5.0 or above
Installation ¶
- put Rbac.php to /protected/components
- put RbacFilter.php to /protected/filters
- put RbacCommand.php to /protected/commands/shell
- Configure 'rbac' component
php 'components'=>array( 'rbac' => array( 'class'=>'application.components.Rbac', ), .......
- import rbac.sql into your empty test(!) database
- add some users to the database manually
tell your controllers to use RbacFilter: ~~~ php public function filters() { return array( array(
'application.filters.RbacFilter', ),
); } ~~~
start adding roles and permissions with the rbac shell command, e.g. run ./protected/yiic shell to enter running shell and then issue rbac command to get its help.
Change Log ¶
February 25, 2009 ¶
- Initial release.
February 28, 2009 ¶
- version 1.1
- AccessControlFilter renamed to RbacFilter (file and the class, don't forget to update filters() method)
- Added application component Rbac
- requires Yii v1.0.3
- rbac component implements two methods for access validation
Filter problem
I'm getting this error:
Filter is invalid. Controller "PostController" does have the filter method...
I' hope that I'll get a fast reply plz:S
Pass by ref deprecated?
Yii Interactive Tool v1.0 (based on Yii v1.0.4)
Please type 'help' for help. Type 'exit' to quit.
>> rbac
PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of runtime function name. If you would like to enable call-time pass-by-refere nce, you can set allow_call_time_pass_reference to true in your INI file. Howev er, future versions may not support this any longer. in /www/testyii3/protected /commands/shell/RbacCommand.php on line 439
:
:
Can anybody advice on this warning?
Nice Extension
Yes, I second that. It should allow developer to name their own tables.
Good job.
Good work!
I think it's really a great extension with a convenient shell tool.
One thing to mention is, I think it's better to allow user to specify the table names since in many cases people have different table naming convention,it's more flexible for developers.
Keep on the great work!
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.