Skip to content

Commit

Permalink
Merge pull request #3 from salsadigitalauorg/uat
Browse files Browse the repository at this point in the history
CKAN 2.10 Upgrade
  • Loading branch information
MarkCalvert authored Oct 30, 2024
2 parents d1f2022 + 18f3edf commit 9485b59
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions ckanext/package_group_permissions/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ def get_all_groups():
return [[group['id'], group['display_name']]
for group in groups if
group['id'] not in pkg_group_ids]

2 changes: 1 addition & 1 deletion ckanext/package_group_permissions/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def member_create(self, next_auth, context, data_dict):
:return:
"""
authorized = False
if g.controller in ['package', 'dataset'] and g.action in ['groups']:
if g.blueprint in ['package', 'dataset'] and g.view in ['groups']:
authorized = helpers.user_has_admin_access(include_editor_access=True)

if not authorized:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% block link %}
{{ super() }}
{% endblock %}
{% if group.user_member or (h.check_access('member_delete', group) and c.controller in ['package', 'dataset'] and c.action in ['groups']) %}
{% if group.user_member or (h.check_access('member_delete', group) and g.blueprint in ['dataset'] and g.view in ['groups']) %}
<input name="group_remove.{{ group.id }}" value="{{ _('Remove') }}" type="submit" class="btn btn-danger btn-sm media-edit" title="{{ _('Remove dataset from this group') }}"/>
{% endif %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ <h2 class="hide-heading">{{ _('Groups') }}</h2>

{% if groups %}
<form class="add-to-group" method="post">
{{ h.csrf_input() }}
<div class="form-group">
<select id="field-add_group" class="form-control" name="group_added">
{% for option in groups %}
Expand All @@ -25,6 +26,7 @@ <h2 class="hide-heading">{{ _('Groups') }}</h2>

{% if c.pkg_dict.groups %}
<form method="post">
{{ h.csrf_input() }}
{% snippet 'group/snippets/group_list.html', groups=c.pkg_dict.groups %}
</form>
{% else %}
Expand Down

0 comments on commit 9485b59

Please sign in to comment.