Files
yii2-usuario/src/User/Controller/PermissionController.php
Leonardo Forconi 1c1ce6ccff
Some checks failed
Build / build (ubuntu-latest, 7.4) (push) Has been cancelled
Build / build (ubuntu-latest, 8.0) (push) Has been cancelled
Build / build (ubuntu-latest, 8.1) (push) Has been cancelled
Build / build (ubuntu-latest, 8.2) (push) Has been cancelled
Build / build (ubuntu-latest, 8.3) (push) Has been cancelled
Build / build (ubuntu-latest, 8.4) (push) Has been cancelled
refactor: renamed namespace from Da\User to pcrt\User
All PHP namespaces and related references have been updated from Da\User to pcrt\User throughout the codebase, including composer.json autoload settings and all source files. This change standardizes the project under the new pcrt\User namespace for improved clarity and maintainability.
2025-10-15 10:22:32 +02:00

52 lines
1018 B
PHP

<?php
/*
* This file is part of the 2amigos/yii2-usuario project.
*
* (c) 2amigOS! <http://2amigos.us/>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace pcrt\User\Controller;
use pcrt\User\Model\Permission;
use pcrt\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}
*
* @throws NotFoundHttpException
*/
protected function getItem($name)
{
$authItem = $this->authHelper->getPermission($name);
if ($authItem !== null) {
return $authItem;
}
throw new NotFoundHttpException();
}
}