yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.24k stars 6.91k forks source link

\yii\web\User::can() and guest #12771

Closed genichyar closed 7 years ago

genichyar commented 8 years ago

Using \yii\web\User::can() for guest always returns false for all my cases. But it checks permissions and executes all relative bizrules.

Why does \yii\web\User::can() not return false for guest default without any checks?

genichyar commented 8 years ago

Problem can be viewed at another point.

Why does \yii\rbac\PhpManager::checkAccess() execute \yii\rbac\PhpManager::checkAccessRecursive even if assignments and defaultRoles are empty?

samdark commented 8 years ago

I guess it could be improved. Need to review code though.

SilverFire commented 7 years ago

Resolved by https://github.com/yiisoft/yii2/commit/5795b3937eab3764a79e180f259dbabd6f655dad