Access Method In Cwebuser And Own User Model

The currently logged in user is Yii::app()->user

I also have a model called User which allows me to get all details about a user of the site with User::model()->findByPK(123)

I’d like to add a check for permissions for both the current user OR any other user.

Is the best way to do this:

  1. Add a duplicated method to both CWebUser and model/User.php

  2. User a User::model()->findByPk($this->id) inside CWebUser and only have the method in model/User.php

  3. Something else

Thanks

try using any rbac extensions or implement your own rbac.