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:
-
Add a duplicated method to both CWebUser and model/User.php
-
User a User::model()->findByPk($this->id) inside CWebUser and only have the method in model/User.php
-
Something else
Thanks
ahmed201
(Rifajas)
2
try using any rbac extensions or implement your own rbac.