ROGUE-JCTD / rogue_geonode

GeoSHAPE - A Django package that adds GeoSHAPE functionality to GeoNode.
http://www.geoshape.org
GNU General Public License v3.0
12 stars 25 forks source link

When viewing a layer, Edit Layer button does not show up if user has permission to edit data _only_ #91

Open BirdSamuel opened 9 years ago

BirdSamuel commented 9 years ago

If a layer is uploaded with permissions set to give data editing rights to a user, the edit layer button (when viewing that layer) isn't there. This only happens if it is only 'edit data' rights - no other permissions.

The user is still able to modify data on MapLoom, that button just doesn't show up.

 

Here is a handful of permission tests for reference: There are 3 users:

Expected Result:

Result:

 

Uploading _BusStops4326_2 as admin_: - Correct

Expected Result:

Result:

 

Uploading SoloAmericas1 as NormalUser: - Correct

Expected Result:

Result:

 

Uploading _SoloAmericas1_2 as SBird_: - Correct

Expected Result:

Result:

 

Uploading _SoloAmericas1_20 as SBird_: - Incorrect

--This is the bug in reference--

Expected Result:

Result:

 

Uploading _SoloAmericas1_21 as SBird_: - Correct

Expected Result:

Result:

 

Uploading _SoloAmericas1_22 as SBird_: - Correct

Expected Result:

Result:

 

Uploading _SoloAmericas1_23 as SBird_: - Correct

Expected Result:

Result:

 

Uploading _SoloAmericas1_24 as NormalUser_: - Correct

Expected Result:

Result:

 

Uploading _SoloAmericas1_25 as NormalUser_: - Correct

Expected Result:

Result:

pjdufour commented 9 years ago

So is this an issue with the html template boolean logic statements then?

https://github.com/GeoNode/geonode/blob/master/geonode/layers/templates/layers/layer_detail.html#L179

In the template, the "Edit Layer" button currently shows if:

if "change_resourcebase_metadata" in perms_list or "change_resourcebase" in perms_list or "delete_resourcebase" in perms_list or "change_layer_style" in layer_perms

Are the add layer permissions not included in "change_resourcebase"?