Allow full access to 'Admin' role

What is the best way override CDbAuthManager->checkAccess() to aways return true when a user is in the ‘Admin’ role?

This way I don't have to add all of the tasks and operations to the admin role.

I'll have a lot of tasks and operations.

I already have my own DbAuthManager class that extends CDbAuthManager.

Something like (pseudo-code):

if (isInRole($userId,'Admin') return true;

It would be cool if we could specify an array with the roles we want to have full access.


Then in the pseudo-code above:

foreach ($fullAccessRolesArray as $role) {

    if (isInRole($userId,$role) return true;


I think your approach is fine. Because you already have your own DbAuthManager, you can add a property like you did to specify the list admin roles. You can then configure this property in the app config.

Ok, thanks!