Difference between #8 and #9 of
Simple authorization system

Revision #9 has been created by manuel-84 on Dec 13, 2011, 11:27:03 PM with the memo:

(integer) accessLevel === (integer) User::LEVEL_SUPERADMIN returns false, does not match
« previous (#8) next (#10) »

Changes

Title unchanged

Simple authorization system

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

auth, authorization, security

Content changed

[...]
```php
class WebUser extends CWebUser{
private $_user;
//is the user a superadmin ?
function getIsSuperAdmin(){
return ( $this->user && $this->user->accessLevel ==
= User::LEVEL_SUPERADMIN );
}
//is the user an administrator ?
function getIsAdmin(){
return ( $this->user && $this->user->accessLevel >= User::LEVEL_ADMIN );
}
[...]
14 0
17 followers
Viewed: 44 800 times
Version: 1.1
Category: How-tos
Written by: Gustavo
Last updated by: Gustavo
Created on: Nov 24, 2011
Last updated: 10 years ago
Update Article

Revisions

View all history