Skip to content

Commit

Permalink
Include perms dict
Browse files Browse the repository at this point in the history
  • Loading branch information
davisc authored Mar 15, 2018
1 parent 9d2d2f2 commit 76c01c9
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 76c01c9

Please sign in to comment.