apache / apache/cloudstack

Switching to project view not working when user is assigned custom Project Role

Đang mở
#14,014 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
component:projects component:UI type:regression
Ngôn ngữ chính
Java
Star
3.1k
Fork
1.4k
Merge trung bình
6 ngày 19 giờ
Pull request đã merge (30 ngày)
32

Mô tả

### problem

If account/user is added to the project with custom role (even if role permisions are "allow *") user can login to CS successfully but switching to project view will fail and generate multiple errors: "

```
The given command 'listApis' either does not exist, is not available for user. Unable to proceed. Please contact your administrator."
The given command 'listZones' either does not exist, is not available for user. Unable to proceed. Please contact your administrator.
The given command 'listCapabilities' either does not exist, is not available for user. Unable to proceed. Please contact your administrator.
...
```

Image

On browser console indeed you can see that request:
` /client/api/?command=listApis&response=json&sessionkey=xxx&projectid=xxx`
returns:
`{"listapisresponse":{"uuidList":[],"errorcode":401,"cserrorcode":9999,"errortext":"The given command 'listApis' either does not exist, is not available for user."}}
`
If user is added to the project with Admin or Regular Type without any project role, switching to project view works correctly.

Switching to project view using custom Project Roles in 4.22.1.0 works correctly.
Also using UI ver. 4.22.1.1 and Api ver: 4.22.1.0 works correctly.

No additional logs available in:
```
cloudstack/management/apilog.log
cloudstack/management/management-server.log
```

### versions

ACS: 4.22.1.1

### The steps to reproduce the bug

1. Create new project "Test"
2. Create Project Role with "allow *" permission
3. Add non-admin user to project with that Project Role
4. Switch to Project View of "Test" project

### What to do about it?

Please track the root cause and fix the bug

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

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

Hướng nghiên cứu

Tái hiện lỗi với một Project Role tùy chỉnh cấp quyền "allow *", sau đó kiểm tra các yêu cầu của chế độ xem dự án đối với listApis, listZones và listCapabilities rồi so sánh chúng với quyền thành viên dự án Admin hoặc Regular. Kiểm tra hành vi trên các phiên bản API/UI 4.22.1.1 và 4.22.1.0. Hoàn tất khi người dùng có vai trò tùy chỉnh có thể chuyển sang chế độ xem dự án mà không gặp lỗi ủy quyền và các yêu cầu được liệt kê thực hiện thành công.

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

Đánh giá

Công nghệ
java
Lĩnh vực
api, authorization
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
55/100

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.