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

Đang mở Phù hợp với người mới
#2,109 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả 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

Bắt đầu với src/features/instance/config/users/isOnlyActiveSuperUser.ts và hộp thoại Edit User trong Config → Users; issue cho biết kiểm tra này được thêm vào ở #2108. Tìm hiểu cách trường Role xử lý việc xác thực và lưu các thay đổi vai trò, sau đó chạy các bài kiểm thử cấu hình người dùng liên quan. Hoàn tất khi không thể gán cho siêu người dùng đang hoạt động duy nhất một vai trò không có super_user và trường Role giải thích lý do.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của HarperFast/studio

Tất cả issue của HarperFast/studio

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.