Skip to content

Commit

Permalink
modify resource check (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
marthamareal authored Mar 30, 2021
1 parent bf6ab16 commit 4742538
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mapstore2_adapter/plugins/geonode.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,15 @@ def convert(self, viewer, request):
if _resolve_layer(request,
selected['name'],
'base.change_resourcebase',
_PERMISSION_MSG_MODIFY):
_PERMISSION_MSG_MODIFY
).user_can(request.user, 'base.change_resourcebase'):
info['canEdit'] = True

if _resolve_layer(request,
selected['name'],
'base.delete_resourcebase',
_PERMISSION_MSG_DELETE):
_PERMISSION_MSG_DELETE
).user_can(request.user, 'base.delete_resourcebase'):
info['canDelete'] = True
except Exception:
tb = traceback.format_exc()
Expand All @@ -223,13 +225,15 @@ def convert(self, viewer, request):
if _resolve_map(request,
str(map_id),
'base.change_resourcebase',
_PERMISSION_MSG_SAVE):
_PERMISSION_MSG_SAVE
).user_can(request.user, 'base.change_resourcebase'):
info['canEdit'] = True

if _resolve_map(request,
str(map_id),
'base.delete_resourcebase',
_PERMISSION_MSG_DELETE):
_PERMISSION_MSG_DELETE
).user_can(request.user, 'base.delete_resourcebase'):
info['canDelete'] = True
except Exception:
tb = traceback.format_exc()
Expand Down

0 comments on commit 4742538

Please sign in to comment.