Bluz\Acl\Acl::isAllowed PHP Method

isAllowed() public method

Check user access by pair module-privilege
public isAllowed ( string $module, string $privilege ) : boolean
$module string
$privilege string
return boolean
    public function isAllowed($module, $privilege) : bool
    {
        if ($privilege) {
            $user = Auth::getIdentity();
            if (!$user || !$user->hasPrivilege($module, $privilege)) {
                return false;
            }
        }
        return true;
    }