Difference between #1 and #2 of
How to setup RBAC with a php file

Revision #2 has been created by bettor on Feb 8, 2010, 9:51:28 AM with the memo:

clarification added
« previous (#1) next (#3) »


Title unchanged

How to setup RBAC with a php file

Category unchanged


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:
24 4
Viewed: 67 998 times
Version: 1.1
Category: How-tos
Written by: bettor
Last updated by: Stageline
Created on: Feb 7, 2010
Last updated: 5 years ago
Update Article


View all history