Created
October 20, 2017 11:19
-
-
Save alexlcdee/8c96d379892e82c23380c3eda273fd41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
'updateModel' => [ | |
// authItem definition | |
'bizRule' => function($params, $data) { | |
return my_biz_rule_code(); | |
} | |
] | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class PhpAuthManager extends CPhpAuthManager | |
{ | |
// your code | |
public function executeBizRule($bizRule, $params, $data) | |
{ | |
$bizRule = $bizRule ? @unserialize($bizRule) : null; | |
if (is_callable($bizRule)) { | |
return call_user_func_array($bizRule, [$params, $data]); | |
} | |
return parent::executeBizRule($bizRule, $params, $data); | |
} | |
// your other code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment