apache / apache/cloudstack

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

Aperta
#14,014 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
component:projects component:UI type:regression
Lingua principale
Java
Stelle
3.1k
Fork
1.4k
Merge medio
6g 19h
PR unite (30g)
32

Descrizione

### 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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Riprodurre il problema con un Project Role personalizzato che conceda "allow *", quindi esaminare le richieste della vista del progetto per listApis, listZones e listCapabilities e confrontarle con l'appartenenza al progetto Admin o Regular. Verificare il comportamento nelle versioni API/UI 4.22.1.1 e 4.22.1.0. Il lavoro è completato quando un utente con un ruolo personalizzato può passare alla vista del progetto senza errori di autorizzazione e le richieste elencate hanno esito positivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
api, authorization
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.