vova07/yii2-start

Admin-update of a permission

Closed this issue · 2 comments

Hey,

Any specific reason to scenario admin-update ( on permission model in rbac ) don't have 'name' on it ?

Thanks.

Hi @nunomaduro ,
Yes, this is like so, because in case you change the permission name it will be like a new one, so all parents of this permission will run into an unexpected error in case it will be used with DbAuthManager just because permission name is a foreign key.

That only happens if the permission have parents:

PhpManager line 579 -> throw new InvalidParamException("Unable to change the item name. The name '{$item->name}' is already used by another item.");

But ok, thank you. I will problably make a pull request the enable update name in this case ( no parents ) and disable input form in the others case ( with parents ).