Use useInstanceOperationPermission for the Active switch once #2104 lands
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 57/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- authentication, frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 5
- Fork
- 4
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 60
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của HarperFast/studio
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
HarperFast/studio#2111 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
HarperFast/studio#2109 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
rum
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
HarperFast/studio#2085 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
HarperFast/studio#2070 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
HarperFast/studio#2067 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của HarperFast/studio
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
hemilabs/ui-monorepo#2711 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
code-yeongyu/senpi#6929 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
lingdojo/kana-dojo#34261 · 1 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
embedpdf/embed-pdf-viewer#1116 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Revise communication normsĐang mởcurrent task
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Sunday-School-Software/Sunday-School-Scheduler#87 ·
Maintainer thường phản hồi trong vòng 1 ngày