Replace send_messages and manage_service strings across application with ServicePermission.SEND_MESSAGES and ServicePermission.MANAGE_SERVICE types

This commit is contained in:
Beverly Nguyen
2025-07-15 23:56:58 -07:00
parent 591231c084
commit 1bf55e7fa3
26 changed files with 127 additions and 116 deletions

View File

@@ -7,7 +7,7 @@ from ordered_set import OrderedSet
from werkzeug.datastructures import MultiDict
from werkzeug.routing import RequestRedirect
from app.enums import NotificationStatus
from app.enums import NotificationStatus, ServicePermission
from notifications_utils.field import Field
SENDING_STATUSES = [
@@ -83,7 +83,7 @@ def unicode_truncate(s, length):
def should_skip_template_page(db_template):
return (
current_user.has_permissions("send_messages")
current_user.has_permissions(ServicePermission.SEND_MESSAGES)
and not current_user.has_permissions("manage_templates", "manage_api_keys")
and not db_template["archived"]
)