yii2-rbac returns false when I call Yii::$app->user->can

时间:2017-11-13 06:44:56

标签: yii2

I have a problem with yii2-rbac. Somewhere in my code I have this:

$user = \Yii::$app->user;
$user->can('editBusiness',['business' => $business]));

The 'editBusiness' permission has a rule with the same name attached to it. The 'execute' method on the rule is being invoked and it behaves as expected, but $user->can always returns false. Any ideas on how I'm getting that result? Thanks in advance...

0 个答案:

没有答案