diff --git a/app/main/views/send.py b/app/main/views/send.py index 70e2f9803..9e5b42fab 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -846,7 +846,7 @@ def get_skip_link(step_index, template): and step_index == 0 and template.template_type in ("sms", "email") and not (template.template_type == "sms" and current_user.mobile_number is None) - and current_user.has_permissions(ServicePermission.SEND_MESSAGES) + and current_user.has_permissions(ServicePermission.SEND_MESSAGES, allow_org_user=True) ): return ( "Use my {}".format(first_column_headings[template.template_type][0]), diff --git a/app/templates/views/templates/_template.html b/app/templates/views/templates/_template.html index ee5964271..62298debd 100644 --- a/app/templates/views/templates/_template.html +++ b/app/templates/views/templates/_template.html @@ -8,7 +8,7 @@

This template was deleted {{ template._template.updated_at|format_datetime_relative }}.

- {% elif not current_user.has_permissions(ServicePermission.SEND_MESSAGES, 'manage_api_keys', ServicePermission.MANAGE_TEMPLATES, ServicePermission.MANAGE_SERVICE) or not user_has_template_permission %} + {% elif not current_user.has_permissions(ServicePermission.SEND_MESSAGES, 'manage_api_keys', ServicePermission.MANAGE_TEMPLATES, ServicePermission.MANAGE_SERVICE, allow_org_user=True) or not user_has_template_permission %}

If you need to send this {{ 1|message_count_label(template.template_type, suffix='') }} @@ -17,12 +17,12 @@ {% else %}

- {% if current_user.has_permissions(ServicePermission.SEND_MESSAGES, restrict_admin_usage=True) %} + {% if current_user.has_permissions(ServicePermission.SEND_MESSAGES, restrict_admin_usage=True, allow_org_user=True) %} Use this template {% endif %} - {% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES) %} + {% if current_user.has_permissions(ServicePermission.MANAGE_TEMPLATES, allow_org_user=True) %} Edit this template diff --git a/app/utils/__init__.py b/app/utils/__init__.py index 80235ac9e..feaf3de1e 100644 --- a/app/utils/__init__.py +++ b/app/utils/__init__.py @@ -73,9 +73,9 @@ def unicode_truncate(s, length): def should_skip_template_page(db_template): return ( - current_user.has_permissions(ServicePermission.SEND_MESSAGES) + current_user.has_permissions(ServicePermission.SEND_MESSAGES, allow_org_user=True) and not current_user.has_permissions( - ServicePermission.MANAGE_TEMPLATES, "manage_api_keys" + ServicePermission.MANAGE_TEMPLATES, "manage_api_keys", allow_org_user=True ) and not db_template["archived"] )