mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
remove any_ from has_permissions
we branch on any_ to either say "require ALL these permissions" or "require ANY of these permissions". But we only ever call the decorator with one permission, or with any_=True, so it's unnecessary
This commit is contained in:
@@ -107,7 +107,7 @@
|
||||
|
||||
{% macro edit_field(text, link, permissions=[]) -%}
|
||||
{% call field(align='right') %}
|
||||
{% if current_user.has_permissions(*permissions, **{'any_': True}) or not permissions %}
|
||||
{% if current_user.has_permissions(*permissions) or not permissions %}
|
||||
<a href="{{ link }}">{{ text }}</a>
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
{% if current_user.has_permissions('manage_service') %}
|
||||
<li><a href="{{ url_for('.usage', service_id=current_service.id) }}">Usage</a></li>
|
||||
{% endif %}
|
||||
{% if current_user.has_permissions('manage_api_keys', 'manage_service', any_=True) %}
|
||||
{% if current_user.has_permissions('manage_api_keys', 'manage_service') %}
|
||||
<li><a href="{{ url_for('.service_settings', service_id=current_service.id) }}">Settings</a></li>
|
||||
{% endif %}
|
||||
{% if current_user.has_permissions('manage_api_keys') %}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
{% if not templates %}
|
||||
{% include 'views/dashboard/write-first-messages.html' %}
|
||||
{% endif %}
|
||||
{% elif not current_user.has_permissions('send_messages', 'manage_api_keys', any_=True) %}
|
||||
{% elif not current_user.has_permissions('send_messages', 'manage_api_keys') %}
|
||||
{% include 'views/dashboard/no-permissions-banner.html' %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user