geonode
geonode copied to clipboard
"Edit" permission for groups broken on datasets with time series.
Expected Behavior
User in a group with edit permission should be able to edit dataset data.
Actual Behavior
Groups with edit permission cannot edit dataset data as long as time series is enabled. They can however edit metadata and information of the dataset.
Everything works fine when adding edit permission to each user individually.
Steps to Reproduce the Problem
- Create a normal user
- Create a group and add the user
- Create or upload a layer with time series enabled using the ADMIN user.
- Remove all access permissions from layer
- Add "edit" permission to the created group for that layer
Using the normal user, it is possible to view the layer and edit some properties of it (metadata), but it is not possible to edit data.
Specifications
- GeoNode version: 4.1.2
- Installation type (vanilla, geonode-project): geonode-project
- Installation method (manual, docker): Docker
- Platform: Ubuntu 22.04
Additional Details
This issue is not related to #11447, as we already patched the problem, while we finish updating the project to Geonode 4.2 .
Solution
After looking in the code, I found out that some permissions were getting removed if the layer was of subtype "vector_time". That can be seen on security/models.py on line 392. After changing
elif self.subtype != "vector":
to elif self.subtype not in ["vector", "vector_time"]:
, the missing permissions were fixed.