Revision #2                                    has been created by  bettor                                    on Feb 8, 2010, 9:51:28 AM with the memo:
 bettor                                    on Feb 8, 2010, 9:51:28 AM with the memo:
                                
                                
                                    clarification added                                
                                                                    « previous (#1)                                                                                                    next (#3) »                                                            
                            Changes
                            
    Title
    unchanged
    How to setup RBAC with a php file
    Category
    unchanged
    Tutorials
    Yii version
    unchanged
    
    Tags
    unchanged
    
    Content
    changed
    In this cookbook I will attempt to explain how to use the lightweight version of [Role-Based Access Control](http://www.yiiframework.com/doc/guide/topics.auth#role-based-access-control) using a php file. This version does not use database but a php file and is controlled by CPhpAuthManager class.
## Configuring the roles: ##
By default 
when setting up this particular type of rbac Yii will look for any defined roles in a file named auth.php and located in protected/data/auth.php
For the sake of easiness I will  add an example of user rbac to the blog demo. 
>Info: Yii expects to read auth.php and get an array() out of it. So we need to create auth.php and return array(); Yii also needs to write to that file when changing roles so make sure to provide enough permission access to that file needed by the system.
Next we declare some roles in our auth.php file:[...]