yii - Specifying Access Rules Specific Error Message In Controller -


i using yii 1.1.10 version in trying specify rules specific error message defining message in accessrules function specified below:

public function accessrules() {     return array(         array('allow', // allow users perform 'index' , 'view' actions             'actions'=>array('xxx','yyy'),             'users'=>array('*'),         ),         array('allow', // allow users perform 'index' , 'view' actions             'message'=>'you must logged in member perform action.',             'actions'=>array('zzz','aaa',),             'expression'=>'authenticationhelper::issessionuseradmin()',         ),         array('deny', // deny users             'users'=>array('*'),             'message' => "this generic message.",         ),     ); } 

however in case expression fails, able view message has been specified against deny rule "this generic message.", when second evaluation fails. points achieve desired behaviour highly appreciated.

you can propably way:

array('allow',     'message'=>'you must logged in member perform action.',     'actions'=>array('zzz','aaa',),     'expression'=>'authenticationhelper::issessionuseradmin()', ), array('deny',     'message'=>'you must logged in member perform action.',     'actions'=>array('zzz','aaa',),     'expression'=>'!authenticationhelper::issessionuseradmin()', ), 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -