Source of file CheckPrivilege.php
Size: 0,670 Bytes - Last Modified: 2017-11-08T13:54:24+00:00
/home/travis/build/bluzphp/framework/src/Controller/Helper/CheckPrivilege.php
123456789101112131415161718192021222324252627282930313233 | <?php /** * Bluz Framework Component * * @copyright Bluz PHP Team * @link https://github.com/bluzphp/framework */ declare(strict_types=1); namespace Bluz\Controller\Helper; use Bluz\Application\Exception\ForbiddenException; use Bluz\Controller\Controller; use Bluz\Proxy\Acl; /** * Denied helper can be declared inside Bootstrap * * @return void * @throws ForbiddenException */ return function () { /** * @var Controller $this */ $privilege = $this->getMeta()->getPrivilege(); if ($privilege && !Acl::isAllowed($this->getModule(), $privilege)) { throw new ForbiddenException; } }; |