34k+
News
Guide
API
Wiki
Forum
Community
Places
Members
Hall of Fame
Badges
More
Learn
Books
Resources
Develop
Download Yii
Extensions
Report an Issue
Report a Security Issue
Contribute to Yii
Donate
About
Release Cycle
License
Team
Official Logos and Design
Login
Add information to Yii::app()->user by extending CWebUser (better version)
Comparing
#7
with
#8
Revision #8 was created by
Anas AbuDayah
on Mar 13, 2014, 9:40:46 AM.
add getId function, add tags
« Previous (#7)
Tags
Yii, user, rbac
Content
[...]
}
public function login($identity, $duration) {
$this->setState('__userInfo', $identity->getUser());
parent::login($identity, $duration);
}
/*
* Required to checkAccess function
* Yii::app()->user->checkAccess('operation')
*/
public function getId()
{
return $this->id;
}
}
?>
```
remember to set that class as Yii::app()->user class:
[...]