Skip to content

Commit

Permalink
Advanced Workflow: fix "request editing" action when published
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Oct 23, 2020
1 parent 6ab54d3 commit 1041b12
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions geonode/base/templatetags/base_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,12 @@ def get_visibile_resources(user):
@register.simple_tag
def display_edit_request_button(resource, user, perms):
def _has_owner_his_permissions():
return (set(resource.BASE_PERMISSIONS.get('owner') + resource.BASE_PERMISSIONS.get('write')) - set(
perms)) == set()
_owner_set = set(resource.BASE_PERMISSIONS.get('owner') +
resource.BASE_PERMISSIONS.get('read') +
resource.BASE_PERMISSIONS.get('write') +
resource.BASE_PERMISSIONS.get('download')) - \
set(perms)
return (_owner_set) == set(['change_resourcebase_permissions', 'publish_resourcebase'])

if not _has_owner_his_permissions() and resource.owner.pk == user.pk:
return True
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pinax-ratings==4.0.0
geonode-avatar==5.0.7
django-geonode-client==1.0.9
geonode-oauth-toolkit==2.1.0
geonode-user-messages==2.0.1
geonode-user-messages==2.0.2
geonode-announcements==2.0.2
geonode-django-activity-stream==0.9.0
gn-arcrest==10.5.3
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ install_requires =
geonode-avatar==5.0.7
django-geonode-client==1.0.9
geonode-oauth-toolkit==2.1.0
geonode-user-messages==2.0.1
geonode-user-messages==2.0.2
geonode-announcements==2.0.2
geonode-django-activity-stream==0.9.0
gn-arcrest==10.5.3
Expand Down

0 comments on commit 1041b12

Please sign in to comment.