Hello,
I had a role named "SuperAdmin" stored in RBAC backend (mysql db) and while in a controller i was using the following:
Quote
{
return array(
'accessControl',
);
}
public function accessRules()
{
return array(
array('allow',
'actions'=>array('view','add','delete','edit'),
'roles'=>array('Superadmin'),
),
array('deny',
'actions'=>array('view','add','delete','edit'),
'users'=>array('*'),
),
);
}</div></div>
The user assigned with the SuperAdmin role was getting a 401 error.
Trying to figure what exactly is happening i ended up in CAuthItem.php::checkAccess() where the following statement:
Quote
return true;</div></div>
was comparing "superadmin" (the role string specified in the controller) with "SuperAdmin" (the role string stored in backend) and of course it didn't return true.
The 'problem' i think is at CAccessControlFilter.php::setRules() where the following statement lowercase every rule supplied:
Quote
$r->$name=array_map('strtolower',$value);</div></div>
What do you think?