Skip to content

Commit

Permalink
fix access to admin links (#5966)
Browse files Browse the repository at this point in the history
  • Loading branch information
escattone authored Apr 22, 2024
1 parent 8204e0c commit 8df9415
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{% if in_staff_group(user) and user.has_perm('announcements.add_announcement') %}
{% if user.is_staff and user.has_perm('announcements.add_announcement') %}
<a class="add" href="{{ url('admin:announcements_announcement_add') }}">{{ _('Add announcement') }}</a>
{% endif %}
{% if announcements %}
<ul id="doc-content" class="announcements">
{% for a in announcements %}
<li>
{% if in_staff_group(user) and user.has_perm('announcements.change_announcement') %}
{% if user.is_staff and user.has_perm('announcements.change_announcement') %}
<a class="edit" href="{{ url('admin:announcements_announcement_change', a.id) }}">{{ _('Edit') }}</a>
{% endif %}
{{ a.content|wiki_to_html }}
Expand Down
2 changes: 1 addition & 1 deletion kitsune/flagit/jinja2/flagit/includes/flagged_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h3 class="sumo-page-intro">{{ _('Flagged:') }}</h3>
<h3 class="sumo-page-intro">{{ _('Take Action:') }}</h3>
<div class="actions sumo-button-wrap">
<a class="sumo-button button-sm" href="{{ object.content_object.get_absolute_url() }}">View</a>
{% if user.has_perm('profile.change_profile') %}
{% if user.is_staff and user.has_perm('profile.change_profile') %}
<a class="sumo-button button-sm edit" href="{{ url('admin:users_profile_change', object.object_id) }}">{{ _('Edit') }}</a>
{% endif %}
</div>
2 changes: 1 addition & 1 deletion kitsune/groups/jinja2/groups/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{% block content %}
<article id="group-list" class="main sumo-page-section">
{% if in_staff_group(user) and user.has_perm('groups.add_groupprofile') %}
{% if user.is_staff and user.has_perm('groups.add_groupprofile') %}
<div class="sumo-button-wrap">
<a class="sumo-button primary-button add" href="{{ url('admin:groups_groupprofile_add') }}">{{ _('Add group profile') }}</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion kitsune/groups/jinja2/groups/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% endif %}
</section>
<section id="main-area">
{% if in_staff_group(user) and user.has_perm('groups.change_groupprofile') %}
{% if user.is_staff and user.has_perm('groups.change_groupprofile') %}
<a class="edit" href="{{ url('admin:groups_groupprofile_change', profile.id) }}">{{ _('Edit in admin') }}</a>
{% endif %}
<h1>{{ profile.group.name }}</h1>
Expand Down

0 comments on commit 8df9415

Please sign in to comment.