Use useInstanceOperationPermission for the Active switch once #2104 lands
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 57/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Read src/hooks/usePermissions.ts, src/hooks/useInstanceOperationPermission.ts, and the Edit User modal that uses the Active switch. After #2104 and #2108 land, compare both hooks for alter_user, including while the instance version loads. Switch the modal to the version-aware hook and remove the specialized hook; done when the permission answers match across those states and the Active switch uses the generic hook.
索引モデルが issue の本文から書いたものです。
説明
Problem
#2108 adds useInstanceAlterUserPermission to src/hooks/usePermissions.ts. It gates the Edit User modal's Active switch on checkSuperUserOperationAllowed(permission, 'alter_user').
Open #2104 adds a generic, version-aware useInstanceOperationPermission(operation) in src/hooks/useInstanceOperationPermission.ts. Once both are merged, Studio has two ways to ask whether the signed-in user can run an operation.
Suggested fix
After both land, switch the modal to useInstanceOperationPermission('alter_user') and remove useInstanceAlterUserPermission. Both read useInstanceAuth().user.role.permission. Check that the version-aware answer matches for alter_user, including while the instance version is still loading, which #2104's hook treats as not allowed.
Review-Deferral: 6946a86b33ff7de3 severity=nit category=maintainability
🤖 Generated by Claude Code (Claude Opus 5.5); posted via @dawsontoth.
- 主要言語
- TypeScript
- スター
- 5
- フォーク
- 4
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 60
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
HarperFast/studio のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
HarperFast/studio#2111 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
HarperFast/studio#2109 ·
メンテナーはふだん 1 日以内に返信
-
rum
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
HarperFast/studio#2085 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
HarperFast/studio#2070 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
HarperFast/studio#2067 ·
メンテナーはふだん 1 日以内に返信
HarperFast/studio の issue をすべて見る
似ている issue
-
Type/Improvement
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
OpenNSW/nsw-srilanka#1259 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
oxc-project/tsrs#1010 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Fission-AI/OpenSpec#2260 ·
メンテナーはふだん 1 日以内に返信
-
Add: ESP 1 UKオープンcheck:passed streams:add
難易度 1/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
area:infra area:storage bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
THU-MAIC/OpenMAIC#2311 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信