mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 02:08:25 -04:00
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:
@@ -3593,6 +3593,33 @@ def create_active_user_view_permissions(with_unique_id=False):
|
||||
)
|
||||
|
||||
|
||||
def create_active_user_create_broadcasts_permissions(with_unique_id=False):
|
||||
return create_service_one_user(
|
||||
id=str(uuid4()) if with_unique_id else sample_uuid(),
|
||||
name='Test User Create Broadcasts Permission',
|
||||
permissions={SERVICE_ONE_ID: [
|
||||
'manage_templates',
|
||||
'create_broadcasts',
|
||||
'reject_broadcasts',
|
||||
'cancel_broadcasts',
|
||||
]},
|
||||
auth_type='webauthn_auth',
|
||||
)
|
||||
|
||||
|
||||
def create_active_user_approve_broadcasts_permissions(with_unique_id=False):
|
||||
return create_service_one_user(
|
||||
id=str(uuid4()) if with_unique_id else sample_uuid(),
|
||||
name='Test User Approve Broadcasts Permission',
|
||||
permissions={SERVICE_ONE_ID: [
|
||||
'approve_broadcasts',
|
||||
'reject_broadcasts',
|
||||
'cancel_broadcasts',
|
||||
]},
|
||||
auth_type='webauthn_auth',
|
||||
)
|
||||
|
||||
|
||||
def create_active_caseworking_user(with_unique_id=False):
|
||||
return create_user(
|
||||
id=str(uuid4()) if with_unique_id else sample_uuid(),
|
||||
|
||||
Reference in New Issue
Block a user