Artesaos\Defender\Traits\HasDefender::hasPermissions PHP Method

hasPermissions() public method

User permissions override role permissions.
public hasPermissions ( array $permissions, boolean $strict = true, boolean $force = false ) : boolean
$permissions array Array of permissions
$strict boolean Check if has all permissions from array or one of them
$force boolean
return boolean
    public function hasPermissions(array $permissions, $strict = true, $force = false)
    {
        $allPermissions = $this->getAllPermissions($force)->pluck('name')->toArray();
        $equalPermissions = array_intersect($permissions, $allPermissions);
        $countEqual = count($equalPermissions);
        if ($countEqual > 0 && ($strict === false || $countEqual === count($permissions))) {
            return true;
        }
        return false;
    }