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 );
}[...]