Only show relevant user permissions for broadcast services

For services with the broadcast permission this hides:
- the ‘View dashboard’ permission (and defaults it to _checked_) because
  all users of broadcast services will need to see the dashboard
- the ‘Manage API keys’ permission (and defaults it to _not checked_)
  because we don’t offer an API integration for broadcast services yet
  – if we do we won’t want existing users to automatically get the
  permission

It relabels:
- the ‘Send’ permission to ‘Prepare and approve’ to match the current,
  slightly clunky language on the templates page
- the ‘Manage settings’ label to not refer to ‘usage’ because broadcast
  services won’t incur cost
This commit is contained in:
Chris Hill-Scott
2020-07-13 11:10:34 +01:00
parent 494636937b
commit 72c1b3d8a1
4 changed files with 215 additions and 7 deletions

View File

@@ -25,6 +25,12 @@ permissions = (
('manage_api_keys', 'Manage API integration'),
)
broadcast_permissions = (
('send_messages', 'Prepare and approve broadcasts'),
('manage_templates', 'Add and edit templates'),
('manage_service', 'Manage settings and team'),
)
def translate_permissions_from_db_to_admin_roles(permissions):
"""