Allow parent-child relationship to permissions

It's even in [the guide](http://www.yiiframework.com/doc-2.0/guide-security-authorization.html#rbac) <kbd>ctrl</kbd><kbd>+</kbd><kbd>f</kbd> `updateownpost`
This commit is contained in:
Alexander Frolov
2017-09-12 19:00:06 +03:00
committed by GitHub
parent 82c54863d6
commit 5243d39b8b

View File

@ -99,7 +99,7 @@ class AuthHelper
public function getUnassignedItems(AbstractAuthItem $model)
{
$excludeItems = $model->item !== null ? [$model->item->name] : [];
$type = $model->getType() == Permission::TYPE_PERMISSION ?: null;
$type = $model->getType() == Permission::TYPE_PERMISSION ? Permission::TYPE_PERMISSION : null;
$items = $this->getAuthManager()->getItems($type, $excludeItems);
return ArrayHelper::map(