[feature] Allow viewing shared objects by non superadministrators as view only
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Lee la solución enlazada desde el issue 238 y, después, inspecciona openwisp_controller/pki/api/serializers.py en la línea de CaListSerializer citada en el informe. Localiza las pruebas de objetos compartidos del admin y de la REST API, o su lógica de pruebas reutilizable existente. Se considera terminado cuando los objetos compartidos pueden ser vistos por usuarios que no son superusuarios, mientras que la creación, modificación y eliminación siguen restringidas a los superusuarios en ambas interfaces, con cobertura para cada modelo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
⚠️ 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.
- Lenguaje dominante
- Python
- Estrellas
- 779
- Forks
- 328
- Merge medio
- 2 d 19 h
- PR fusionados (30 d)
- 7
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openwisp/openwisp-controller
-
[fix] Recent Commands row uses "created" timestamp for the "Modified" fieldPosiblemente ocupada @xovishnukosuri la tomó hace 216 días. Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
openwisp/openwisp-controller#1263 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
[feature] Emit a signal when a device operating system changesPosiblemente ocupada @Vara715 la tomó hoy. Abiertoenhancement
Dificultad 3/5 Medio día Aptitud para principiantes 65/100
openwisp/openwisp-controller#1506 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
[feature] Add board_name field to Device model for DTB board identificationQuizá libre de nuevo @atif09 la tomó hace 28 días y no hay ningún pull request abierto. Abiertoenhancement gsoc
openwisp/openwisp-controller#1491 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[bug:gsoc26] Mass command wizards started in two browser tabs overwrite each otherPosiblemente ocupada @dee077 la tomó hace 31 días. Abiertobug
openwisp/openwisp-controller#1489 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
openwisp/openwisp-controller#1484 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de openwisp/openwisp-controller
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
PolicyEngine/policyengine-us#10262 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
kellyjonbrazil/jc#788 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
`/search.json` ignores the documented `editions.sort` parameterPosiblemente ocupada @PranavD2905 la tomó hoy. AbiertoAffects: Server Good First Issue Module: Solr Needs: Triage Theme: Public APIs Theme: Search
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
internetarchive/openlibrary#13989 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug P2: misleading query
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
jeffknupp/association#478 ·