[solved] RBAC not working :(


$bizRule='return true';




$auth->assign('someUser', Yii::app()->user->id);

defined access rules:






that access rules works, because user can enter the action, so he is 'someUser', but when I try to do:

var_dump( Yii::app()->user->checkAccess('userPanel') );

it gives me false :( :( :( why is that

There's a bug about role name case-sensitivity. It has been fixed in SVN.

lol… it works, but all the bizRules must have ; in the end

in CAuthManager it should be then:


	 * Executes the specified business rule.

	 * @param string the business rule to be executed.

	 * @param array parameters passed to {@link IAuthManager::checkAccess}.

	 * @param mixed additional data associated with the authorization item or assignment.

	 * @return boolean whether the business rule returns true.

	 * If the business rule is empty, it will still return true.


	public function executeBizRule($bizRule,$params,$data)


		return empty($bizRule) || @eval($bizRule.';')!=0;


The bizRule should be one or several PHP statements. That means you should provide the semicolon at each line of the statements.

in the guide you did not write anything about it, all examples are without semicolon  :-\

Thanks for the suggestion. I just updated the doc.