Skip to content

Commit

Permalink
[Fixes #3919] fix updatelayers command
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Sep 25, 2018
1 parent 297a096 commit 55f2be3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions geonode/security/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,15 @@ def sync_geofence_with_guardian(layer, perms, user=None, group=None):
if allowed:
if user:
logger.debug("Adding to geofence the rule: %s %s %s" % (layer, service, user))
_update_geofence_rule(layer.name, layer.workspace, service, user=user)
_user = user if isinstance(user, basestring) else user.username
_update_geofence_rule(layer.name, layer.workspace, service, user=_user)
else:
logger.debug("Adding to geofence the rule: %s %s *" % (layer, service))
_update_geofence_rule(layer.name, layer.workspace, service)
if group:
logger.debug("Adding to geofence the rule: %s %s %s" % (layer, service, user))
_update_geofence_rule(layer.name, layer.workspace, service, group=group.name)
_group = group if isinstance(group, basestring) else group.name
_update_geofence_rule(layer.name, layer.workspace, service, group=_group)
set_geofence_invalidate_cache()


Expand Down

0 comments on commit 55f2be3

Please sign in to comment.