This extension provides a yiic shell command that can be used to initialize RBAC DB tables, especially during development. Configuration is provided by an authinit file, that allows Tasks, Operations, and Roles to be defined as array values. I found the SRBAC configuration screens to not sufficiently take advantage of Yii's ability to fully nest RBAC items, and also wanted a way to define configs independent of database tables during development, so that auth config information isn't lost (or needing to be archived) between database resets.
Notes ¶
- This command is lightly tested - I use it in my daily development, but there may be issues that arise so YMMV, I'll post updates as I make them.
- Currently this command removes all RBAC information prior to running, including user assignments. Because of this, it's currently only appropriate for development work, or for small sites that can statically define all user assignments in the AuthInitCommand config file.
- This command is only compatible with CDbAuthManager
Future Features ¶
- provide option to preserve authassignments, for updating RBAC configuration on production systems
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.0 or above
- CDbAuthManager for RBAC
Installation ¶
- Extract the release file
- Place AuthInitCommand.php in your application's command directory
- place authinit.php in your application's config directory, and configure according to the examples provided in authinit.php comments
- To run, use your applications yiic.php script with the "authinit" command argument. Example: /pathto/yiic.php auth
- To specify an alternate config file location, use: /pathto/yiic.php auth /absoluate/pathto/alternateconfig.php
Usage ¶
Default config file (config/authinit.php): ¶
/pathto/application/bin/yiic.php auth
Custom config file location: ¶
/pathto/application/bin/yiic.php auth /absolute/path/to/custom_authinit.php
Change Log ¶
March 17, 2010 ¶
- Initial release.
March 18, 2010 ¶
- v0.2a
- fixed a massive bug when creating tasks
Uploaded Zip version
Uploaded a zip version which uncompresses correctly...
re: Download Failed
Hmm - I just noticed the same thing. I've verified that the archive untars for me locally, but after uploading then downloading the file, it shows up as corrupted. I'll have to play around with it when I have more time, but it seems like it's an issue with yiiframework.com storing and delivering the archive...
Download Failed
I dont know if it is me but when I download the file it allways tell me it is corrupt.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.