canManage($user)) { return true; } $excluded = array_map('intval', (array) $this->settings->get(self::EXCLUDED_ROLES, [])); return $excluded === [] || ! $user->roles()->whereIn('roles.id', $excluded)->exists(); } public function canManage(?User $user): bool { return (bool) $user?->can('qm.manage'); } }