Edit User: the only active super user can be demoted through Role on Harper before 5.2.1

オープン 初心者向け
#2,109 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

src/features/instance/config/users/isOnlyActiveSuperUser.ts と Config → Users の Edit User モーダルから始めます。issue によると、このチェックは #2108 で追加されました。Role フィールドがバリデーションを処理し、ロールの変更を保存する方法を追跡し、関連するユーザー設定のテストを実行します。唯一のアクティブなスーパーユーザーに super_user を含まないロールを割り当てられず、Role フィールドがその理由を説明する状態になれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Problem

The Edit User modal in Config → Users locks the Active switch on for an instance's only active super user (#2108). Harper before 5.2.1 applies a deactivation that leaves no active super user, so Studio refuses it.

The Role field has no such check. Picking a role without super_user for that same user and saving sends alter_user with the new role, and Harper before 5.2.1 applies that too. The instance is left with no active super user, through a form whose Active switch says the user "can't be deactivated".

From Harper 5.2.1, alterUser refuses both changes itself: assertActiveSuperUserRemains runs whenever role or active changes.

Suggested fix

Run isOnlyActiveSuperUser (src/features/instance/config/users/isOnlyActiveSuperUser.ts, added in #2108) against role changes too. When the target is the only active super user, refuse a role without super_user and say why beside the Role field.

Review-Deferral: e696e5372625ebcd severity=minor category=data-integrity

🤖 Generated by Claude Code (Claude Opus 5.5); posted via @dawsontoth.

主要言語
TypeScript
スター
5
フォーク
4
平均マージ
2日 13時間
マージ済み PR(30日)
60

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

HarperFast/studio のほかの issue

HarperFast/studio の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。