added RBAC

This commit is contained in:
Antonio Ramirez
2016-12-14 02:26:02 +01:00
parent 9409da4c89
commit 9f1a60b542
43 changed files with 1625 additions and 245 deletions

View File

@ -0,0 +1,41 @@
<?php
namespace Da\User\Controller;
use Da\User\Model\Permission;
use Da\User\Search\PermissionSearch;
use yii\web\NotFoundHttpException;
class PermissionController extends AbstractAuthItemController
{
/**
* @inheritdoc
*/
protected function getModelClass()
{
return Permission::class;
}
/**
* @inheritdoc
*/
protected function getSearchModelClass()
{
return PermissionSearch::class;
}
/**
* @inheritdoc
*/
protected function getItem($name)
{
$authItem = $this->authHelper->getPermission($name);
if ($authItem !== null) {
return $authItem;
}
throw new NotFoundHttpException();
}
}