Source of file Acl.php
Size: 0,778 Bytes - Last Modified: 2017-11-08T13:54:24+00:00
/home/travis/build/bluzphp/framework/src/Acl/Acl.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344 | <?php /** * Bluz Framework Component * * @copyright Bluz PHP Team * @link https://github.com/bluzphp/framework */ declare(strict_types=1); namespace Bluz\Acl; use Bluz\Common\Options; use Bluz\Proxy\Auth; /** * Acl * * @package Bluz\Acl * @author Anton Shevchuk * @link https://github.com/bluzphp/framework/wiki/Acl */ class Acl { use Options; /** * Check user access by pair module-privilege * * @param string $module * @param string $privilege * * @return bool */ public function isAllowed($module, $privilege): bool { if ($privilege) { $user = Auth::getIdentity(); return $user && $user->hasPrivilege($module, $privilege); } return true; } } |