UI: a role denied one non-essential bootstrap API (e.g. listLdapConfigurations) fails to load the entire console

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

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
85/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ệ
javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu trong ui/src/store/modules/user.js tại GetInfo, đặc biệt là listLdapConfigurations và các handler dung sai listNetworkServiceProviders/listGuiThemes. Kiểm tra ui/src/permission.js để hiểu đường dẫn lỗi của route guard. Được xem là hoàn tất khi một lần đọc bootstrap không thiết yếu bị từ chối đặt flag của nó về giá trị mặc định mà không reject GetInfo, để console được tải thay vì chuyển hướng đến /user/login.

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

Mô tả

component:UI
problem

The web console fails to load entirely for any role denied one non-essential bootstrap read. GetInfo runs several independent calls under a single shared Promise and wires several to the same reject, including listLdapConfigurations, which only sets a flag. When a role denies it the 432 rejects the shared promise before listApis can resolve it (a race the small query usually wins), so GetInfo rejects and the router guard logs the user out instead of building routes. The tolerant pattern sits right beside it: listNetworkServiceProviders swallows its own error and the console still loads (listGuiThemes likewise).

Expected: a denied non-essential read degrades like listNetworkServiceProviders/listGuiThemes. Actual: blank console, redirect to /user/login.

versions

4.22 and current main. Client-side UI only; hypervisor/storage/network irrelevant.

The steps to reproduce the bug
  1. Create a custom role (e.g. from the DomainAdmin base type) that denies listLdapConfigurations.
  2. Assign an account to it.
  3. Log in to the web UI — the console never renders and you are redirected to login.
What to do about it?

Give listLdapConfigurations (and any non-essential bootstrap read) its own .catch that defaults the flag, as listNetworkServiceProviders already does. The underlying hazard is the shared resolve/reject across independent calls in GetInfo; reserve reject for genuinely essential calls such as listApis.

Ngôn ngữ chính
Java
Star
3.1k
Fork
1.4k
Merge trung bình
7 ngày 5 giờ
Pull request đã merge (30 ngày)
28

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 apache/cloudstack

Tất cả issue của apache/cloudstack

Issue tương tự

Thêm issue về Java

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.