public function hasFlags(array $flags, bool $matchAll = false) : bool
    {
        $matched = false;
        $userFlags = $this->getUserFlags();

        foreach ($flags as $flag) {
            if (in_array($flag, $userFlags)) {
                if ($matchAll) {
                    $matched = true;
                    continue;
                }

                $matched = true;
            } else {
                if ($matchAll) {
                    return false;
                }

                $matched = false;
            }
        }

        return $matched;
    }