Changes
Title
unchanged
Implementing a Flat User Access System
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
rbac, authorization, access control
Content
changed
[...]
```php
class EWebUser extends CWebUser
{
private $_userTable = array
(
0=>'Guest',
1=>'Normal
user',
21=>'Editor',
8=>'Admin',
9=>'Superuser'[...]
//Access this via Yii::app()->user->roleName()
return (Yii::app()->user->isGuest) ? $this->getUserLabel(0)'' : $this->getUserLabel($this->level);
}
public function getUserLabel($level)
{
//Use this for example as a column in CGridView.columns:[...]