Skip to content

Commit

Permalink
Merge pull request GeoNode#174 from boundlessgeo/BEX-834-1.4.x
Browse files Browse the repository at this point in the history
Include perms dict in layer metadata response
  • Loading branch information
Daniel Berry authored Mar 15, 2018
2 parents 9d2d2f2 + 76c01c9 commit 06bf073
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions geonode/layers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,11 @@ def decimal_default(obj):
if layer_obj.is_remote:
url = layer_obj.ows_url

permissions = { 'edit_style': False}

if request.user.has_perm('change_layer_style', obj=layer_obj):
permissions.update({'edit_style': True})

response = {
'typename': layername,
'name': layer_obj.name,
Expand All @@ -775,6 +780,7 @@ def decimal_default(obj):
'bbox_y1': layer_obj.bbox_y1,
'type': slugify(layer_obj.display_type),
'styles': styles,
'permissions': permissions,
'versioned': layer_obj.geogig_enabled,
'attributes': attributes_as_json(layer_obj)
}
Expand Down

0 comments on commit 06bf073

Please sign in to comment.