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.
- 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
- Yii 1.0 or above
- CDbAuthManager for RBAC
- 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
Default config file (config/authinit.php):
Custom config file location:
/pathto/application/bin/yiic.php auth /absolute/path/to/custom_authinit.php
Change Log ¶
March 17, 2010 ¶
March 18, 2010 ¶
- fixed a massive bug when creating tasks