Edit User modal errors for a role that can alter users but not list roles

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

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
react, typescript

調査の方向性

まず AlterUserForm.tsx を読み、特にロールのクエリと送信される role の値を確認してください。UI が閲覧者に list_roles を実行する権限があるかどうかをどのように判断し、alter_user の呼び出しをどのように送信するかを確認してください。list_roles の権限がない閲覧者がモーダルを開け、現在のロールを読み取り専用で確認でき、ロールが変更された場合にのみ送信されれば完了です。可能であれば、該当するフォームのテストを実行してください。

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

説明

Problem

The Edit User modal in Config → Users loads the role list with list_roles and sends any error to the error boundary (throwOnError: true in AlterUserForm.tsx). A role whose operations allowlist grants list_users and alter_user but not list_roles therefore can't open the modal at all. It sees an error screen instead of the form, so it can't change a password, a role, or (after #2108) the Active flag, even though Harper would accept those alter_user calls.

#2108 stops offering the Active switch to such a role, so the gap no longer looks like a broken control. The modal itself still fails. This predates #2108.

Suggested fix

Run the roles query only when the viewer can run list_roles. Without it, show the user's current role read-only and send role only when it changed.

Review-Deferral: 8c927742a58f7d93 severity=minor category=correctness

🤖 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 を短くまとめたダイジェスト。