Switching to project view not working when user is assigned custom Project Role
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 1.4k
- Merge medio
- 6 d 19 h
- PR fusionados (30 d)
- 32
Descripción
### 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.
...
```
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
Guía de contribución
Línea de trabajo
Reproduce el fallo con un Project Role personalizado que conceda "allow *"; después, inspeccione las solicitudes de la vista del proyecto para listApis, listZones y listCapabilities y compárelas con la pertenencia al proyecto Admin o Regular. Compruebe el comportamiento en las versiones de API/UI 4.22.1.1 y 4.22.1.0. Se considera terminado cuando un usuario con un rol personalizado puede cambiar a la vista del proyecto sin errores de autorización y las solicitudes indicadas se completan correctamente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- api, authorization
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 55/100