Allow users with new broadcast permissions access to routes

Added two new permissions - `create_broadcasts` and
`approve_broadcasts`. These new permissions get added to the
`has_permissions` decorator of the broadcast routes to allow the routes
to be accessed with either the old permissions on the new ones while we
switch over.

We were using the `send_messages` permission for the broadcast routes.
By having two new permissions we can allow a more granular control of
these routes.
This commit is contained in:
Katie Smith
2021-06-17 18:03:58 +01:00
parent 078ac10c8d
commit a66a31c944
4 changed files with 145 additions and 22 deletions

View File

@@ -6,6 +6,8 @@ roles = {
'manage_service': ['manage_users', 'manage_settings'],
'manage_api_keys': ['manage_api_keys'],
'view_activity': ['view_activity'],
'create_broadcasts': ['manage_templates', 'create_broadcasts', 'reject_broadcasts', 'cancel_broadcasts'],
'approve_broadcasts': ['approve_broadcasts', 'reject_broadcasts', 'cancel_broadcasts'],
}
# same dict as above, but flipped round