Closed JiLiZART closed 3 years ago
After checking default roles it checks permissions tree recursively so it should work. Needs to be verified.
It does not check permissions for guest, cuz guest don't have 'id
and all execution passed to https://github.com/yiisoft/yii2/blob/master/framework/rbac/DbManager.php#L106
Ah, right. You've created a role "guest". I didn't got it since it's quite unusual case.
Roles are meant to be assigned to users and guest isn't really a user yet.
If something is available for guest isn't it better to remove any checks from it? If you need to make sure it's available for guests only you can use special symbols in case of controller access filter.
I use permissions checking in whole site, i don't know, would be permission available to guest or not (
I got an error when using ./yii migrate
PHP Fatal Error 'yii\base\ErrorException' with message 'Call to a member function createRole() on a non-object' in /home/root/public_html/cgpr/migrations/m141216_031227_crea_roles_para_usuarios_predefinidos.php:13
Stack trace:
how I can fix it?
@RoyArgaez this is not related to the issue, also github is a bug tracker, please use the forum to ask questions: http://www.yiiframework.com/forum/
Thanks a lot, i didn't know.
Closing due to inactivity. If this should be reopen please write here.
I have list of permissions,
i create roles
add permission
commentView
toguest
role, add itemscommentCreate
,commentUpdate
,guest
touser
role.configure rbac manager
In my app i perform check
Yii::$app->user->can('commentView')
, but it does not work for guest, cuz rbac manager only check role fromdefaultRoles
. https://github.com/yiisoft/yii2/blob/master/framework/rbac/DbManager.php#L106I can't use role checking, cuz i can assign permissions dynamically