[feature] Allow viewing shared objects by non superadministrators as view only
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Leggi la soluzione collegata dall’issue 238, quindi esamina openwisp_controller/pki/api/serializers.py alla riga di CaListSerializer citata nel report. Individua i test dell’admin e della REST API per gli oggetti condivisi, oppure la logica di test riutilizzabile già esistente. Il lavoro è completato quando gli oggetti condivisi sono visualizzabili dagli utenti non superuser, mentre la creazione, la modifica e l’eliminazione rimangono limitate ai superuser in entrambe le interfacce, con copertura per ogni modello.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
⚠️ Not suited to beginner contributors.
Implement the solution devised in https://github.com/openwisp/openwisp-users/issues/238.
We must add tests (ideally reusable test logic to make maintainance sane) that for each model verify the following:
- shared objects can be viewed in readonly mode also by non superusers (admin and REST API)
- new shared object can be created only by superusers (admin and REST API)
- existing shared objects can only be changed/deleted by superusers (admin and REST API)
I found that after upgrading DRF to 3.16 endpoints using the CaListSerializer were failing with the following error:
assert not (required and default is not empty), NOT_REQUIRED_DEFAULT
AssertionError: May not set both `required` and `default`
It happens because of this line:
https://github.com/openwisp/openwisp-controller/blob/1745a0a04f43708d7b402a292d208ca20a010376/openwisp_controller/pki/api/serializers.py#L81
If I remove that line, the tests pass, but I am then able to create a shared Ca with a non superuser org admin/manager user account, which is not what we want and is worrying: we need tests to protect us from these possible security holes.
I also verified that upgrading to DRF 3.16 allows to create objects by omitting the "organization" field, hence allowing non superusers to omit this field and create shared objects, opening security holes.
I think it may be necessary to work on these changes while also upgrading DRF to 3.16 and bind the version, otherwise we may have to work on this twice.
- Lingua principale
- Python
- Stelle
- 779
- Fork
- 328
- Merge medio
- 2g 19h
- PR unite (30g)
- 7
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openwisp/openwisp-controller
-
[fix] Recent Commands row uses "created" timestamp for the "Modified" fieldForse già presa @xovishnukosuri l’ha presa 217 giorni fa. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
openwisp/openwisp-controller#1263 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[feature] Emit a signal when a device operating system changesForse già presa @Vara715 l’ha presa 1 giorno fa. Apertaenhancement
Difficoltà 3/5 Mezza giornata Idoneità per principianti 65/100
openwisp/openwisp-controller#1506 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[feature] Add board_name field to Device model for DTB board identificationForse di nuovo libera @atif09 l’ha presa 28 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement gsoc
openwisp/openwisp-controller#1491 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[bug:gsoc26] Mass command wizards started in two browser tabs overwrite each otherForse già presa @dee077 l’ha presa 31 giorni fa. Apertabug
openwisp/openwisp-controller#1489 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
openwisp/openwisp-controller#1484 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di openwisp/openwisp-controller
Issue simili
-
bot-triaged module: LrScheduler module: optimizer triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
documentation glm5 llm-model
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vllm-project/vllm-ascend#19062 ·
I maintainer di solito rispondono entro 1 giorno
-
Author Page: shuai-zhao-llmApertaauthor-page correction
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
acl-org/acl-anthology#10496 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Issue Type: Bug Report
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
celery/celery#10875 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
SasanLabs/VulnerableApp#836 ·
I maintainer di solito rispondono entro 1 giorno