Easy Way To Assign 'admin' Role And Use Isadmin To Validate

Hello !!! Here, I am going to ask you again a silly and stupid question. But as a newbie, I am not getting it pretty well. I have a webpage and a table named ‘Users’. I have used this table ‘Users’ to register, login and do the rest of the work. Now, I need the a separate role (‘Admin’ role) to manage/control some things .

Now, the question is :

  1. While registering a user in ‘Users table’. I want to give user a role -> Admin.

  2. While logging from ‘Users table’, it will check whatever he/she is admin or not ? if Admin then ‘isadmin’ function will be used to show some url/menu -> how it can be done ?

  3. Right now i am using this : allow(‘user1_name’, ‘user2_name’);

But, so if the ‘admin’ role is enabled then will this work : allow(‘admin’) ?

My current option:

  1. Yiii-user-management : tried, but did not install or whatever, I do not know

  2. Yii-User : did not install.

  3. Using auth: trying, still having problem

  4. create webuser page extends cwebuser : giving error

What will be the easiest way to give a user ‘Admin’ role and how to use the role in allow() and ‘isadmin’ ?

If you know the way, please give me every step by step part to proceed.

Thanks for reading, any feedback will be a big help for this newbie.

Wiki articles:

Simple authorization system

Simple RBAC

Thanks, I got it before about how to check with admin and guest using simple cwebuser. But, How can I set a user as ‘admin’ while registering. if one user wants to get registered as admin, then how it can be happen ? Because, I think, here the role has been assigned while logging in session, what about assign a user in role admin while registering…

thanks, I was a idiot. Did not read with patient first. Thanks a lot Joblo.