Switching to project view not working when user is assigned custom Project Role
- Langage dominant
- Java
- Étoiles
- 3.1k
- Forks
- 1.4k
- Merge moyen
- 6 j 19 h
- PR mergées (30 j)
- 32
Description
### 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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduisez l’échec avec un Project Role personnalisé accordant "allow *", puis examinez les requêtes de la vue du projet pour listApis, listZones et listCapabilities et comparez-les avec une appartenance au projet Admin ou Regular. Vérifiez le comportement avec les versions API/UI 4.22.1.1 et 4.22.1.0. La tâche est terminée lorsqu’un utilisateur doté d’un rôle personnalisé peut passer à la vue du projet sans erreurs d’autorisation et que les requêtes indiquées aboutissent.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- api, authorization
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 55/100