Revision #4 has been created by Trejder on Apr 15, 2013, 6:19:45 PM with the memo:
Some fixes to class' original code
« previous (#3)
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:[...]