AccessRules

Hi guys,

Is it possible to use a PHP function in an expression?

Something like:




array('allow',  

	'actions'=>array('create','update','delete'),				

	'expression'=>'(strpos(Yii::app()->user->userAccess["code"],"s")>-1)',

),



Basically it should check if "s" exist and only allow access when it does.

Your comments will be appreciated.

Here’s the expression documentation for CAccessRule. Since CComponent’s evaluateExpression() will be used, it should be possible to pass a PHP expression string to be eval’d.

/Tommy