to create admin role, and now i will try to figure out how to use that manager.
But any way i need to know how to access custom "User" table fields/ Are they being stored in user object somewhere, or i need to get in from database using one extra query?
i assigned user id#1 to role 'admin', but how do i assign 'accessManager' operation to that user? or to that role? And most important, how do i check if it's there?
what should i put in template to see if curret user can do 'accessManager' operation? How do i check in template that this user is in admin role?
If you are using a single field to indicate the access level, you don't need to use auth manager, which is typically used for more complex access controls.
In order to access the table column 'is_admin' via Yii::app()->user, you will need to extend CWebUser and define a property like the following:
public function getIsAdmin()
{
return User::model()->findByPk($this->id)->is_admin;
}
Could you please give me a hint, which class should i extend and which method should i rewrite, so that every time a User data is being retrieved from database, it also gets some extra data for that user, from another table, and gives me access to it.
also, it would be nice if I could do all this everywhere BUT during authorization