Difference between #3 and #4 of
Implementing a Flat User Access System

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:
[...]
6 0
7 followers
Viewed: 17 859 times
Version: 1.1
Category: How-tos
Written by: Trejder
Last updated by: Trejder
Created on: Apr 10, 2013
Last updated: 11 years ago
Update Article

Revisions

View all history