checkAccess params

How do I access the params in the rule when passing params into checkAccess.

if(Yii::app()->user->checkAccess("event_manual_signup", array("id" => $id, "user_id" => $_POST["UserEvent"]["fk_id_with_user_id"])))

How do I access the ID in the rule / operation I am making.

You have to use $params[‘yourKey’] in the bizRule.

See the documentation using-business-rules.




//$params["post"] is a user object (f.e. owner)


$bizRule='return Yii::app()->user->id==$params["post"]->authID;';


$task=$auth->createTask('updateOwnPost','update a post by author himself',$bizRule);


//checkAccess with the param 'post':


Yii::app()->user->checkAccess('updateOwnPost',array('post'=>$owner))




In your case you can use in the bizRule: $params[‘id’],$params[‘user_id’]…

Ok thanks.