Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide activity stream if the user is not allowed #8153

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/8153.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hide link if the user does not have permission to view the page.
2 changes: 2 additions & 0 deletions ckanext/activity/templates/group/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

{% block content_primary_nav %}
{{ super() }}
{% if h.check_access('group_activity_list', {'id': group_dict.id}) %}
{{ h.build_nav_icon('activity.group_activity', _('Activity Stream'), id=group_dict.name, offset=0, icon='clock') }}
{% endif %}
{% endblock content_primary_nav %}
2 changes: 2 additions & 0 deletions ckanext/activity/templates/organization/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

{% block content_primary_nav %}
{{ super() }}
{% if h.check_access('organization_activity_list', {'id': group_dict.id}) %}
{{ h.build_nav_icon('activity.organization_activity', _('Activity Stream'), id=group_dict.name, offset=0, icon='clock') }}
{% endif %}
{% endblock content_primary_nav %}
2 changes: 2 additions & 0 deletions ckanext/activity/templates/package/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

{% block content_primary_nav %}
{{ super() }}
{% if h.check_access('package_activity_list', {'id': pkg.id}) %}
{{ h.build_nav_icon('activity.package_activity', _('Activity Stream'), id=pkg.id if is_activity_archive else pkg.name, icon='clock') }}
{% endif %}
{% endblock content_primary_nav %}
2 changes: 2 additions & 0 deletions ckanext/activity/templates/user/read_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

{% block content_primary_nav %}
{{ super() }}
{% if h.check_access('user_activity_list', {'id': user.id}) %}
{{ h.build_nav_icon('activity.user_activity', _('Activity Stream'), id=user.name, icon='clock') }}
{% endif %}
{% endblock %}