diff --git a/ckanext/d4science_theme/templates/package/read_base.html b/ckanext/d4science_theme/templates/package/read_base.html index 4b650c3..b2b8b1f 100644 --- a/ckanext/d4science_theme/templates/package/read_base.html +++ b/ckanext/d4science_theme/templates/package/read_base.html @@ -36,27 +36,18 @@ if(window.addEventListener){ {% if h.check_access('package_update', {'id':pkg.id }) %} {# CODE ADDED BY Francesco Mangiacrapa #} + {# see ticket #26641 - ONLY THE SYSADMINS see the Manage button #} + {% set is_sys_admin = true if (c.userobj and c.userobj.sysadmin) else false %} {% set hide = h.get_cookie_value('ckan_hide_header') %} {# INTO PORTAL - FROM D4SCIENCE PORTAL #} {% if hide and hide == 'true' %} - {% set username_id = c.userobj.id %} - {% set pkg_creator_user_id = pkg.creator_user_id %} - {% set role_for_user = h.d4science_theme_get_user_role_for_group_or_org(pkg.organization.id, username_id) %} - {% if role_for_user %} - {% if role_for_user == 'admin' %} - {% link_for _('Manage'), controller='package', action='edit', id=pkg.name, class_='btn', icon='wrench' %} - {% else %} - {% if role_for_user == 'editor' %} - {# IF THE USER HAS ROLE EDITOR HE/SHE CAN EDIT ONLY ITS DATASET, see related ticket #5119 #} - {% if username_id == pkg_creator_user_id %} - {% link_for _('Manage'), controller='package', action='edit', id=pkg.name, class_='btn', icon='wrench' %} - {% endif %} - {% endif %} - {# NOT SHOW 'Manage' #} - {% endif %} + {% if is_sys_admin %} + {% link_for _('Manage'), controller='package', action='edit', id=pkg.name, class_='btn', icon='wrench' %} {% endif %} {% else %} - {% link_for _('Manage'), controller='package', action='edit', id=pkg.name, class_='btn', icon='wrench' %} + {% if is_sys_admin %} + {% link_for _('Manage'), controller='package', action='edit', id=pkg.name, class_='btn', icon='wrench' %} + {% endif %} {% endif %} {% endif %} {% endblock %}