Source of file AbstractRowEntity.php
Size: 0,783 Bytes - Last Modified: 2017-11-08T13:54:24+00:00
/home/travis/build/bluzphp/framework/src/Auth/AbstractRowEntity.php
1234567891011121314151617181920212223242526272829303132333435363738394041424344 | <?php /** * Bluz Framework Component * * @copyright Bluz PHP Team * @link https://github.com/bluzphp/framework */ declare(strict_types=1); namespace Bluz\Auth; use Bluz\Db\Row; /** * Abstract class for Users\Row * * @package Bluz\Auth */ abstract class AbstractRowEntity extends Row implements EntityInterface { /** * Get user privileges * * @return array */ abstract public function getPrivileges(): array; /** * Has role a privilege * * @param string $module * @param string $privilege * * @return bool */ public function hasPrivilege($module, $privilege): bool { $privileges = $this->getPrivileges(); return in_array("$module:$privilege", $privileges, true); } } |