mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-12 05:10:45 -04:00
Split the templates permission out again
It will likely be the same people who have permission to create alerts and edit templates (maybe someone in a comms role). But combining the two permissions makes the options presented in the form feel clunky because ‘alerts’ and ‘templates’ are conceptually quite different. So I think it makes sense to keep the templates permission the same as it is for regular Notify services.
This commit is contained in:
@@ -6,7 +6,7 @@ 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'],
|
||||
'create_broadcasts': ['create_broadcasts', 'reject_broadcasts', 'cancel_broadcasts'],
|
||||
'approve_broadcasts': ['approve_broadcasts', 'reject_broadcasts', 'cancel_broadcasts'],
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ permissions = (
|
||||
)
|
||||
|
||||
broadcast_permissions = (
|
||||
('create_broadcasts', 'Add new alerts and templates'),
|
||||
('manage_templates', 'Add and edit templates'),
|
||||
('create_broadcasts', 'Add new alerts'),
|
||||
('approve_broadcasts', 'Approve alerts'),
|
||||
)
|
||||
|
||||
|
||||
@@ -212,12 +212,14 @@ def test_should_show_overview_page_for_broadcast_service(
|
||||
page = client_request.get('main.manage_users', service_id=SERVICE_ONE_ID)
|
||||
assert normalize_spaces(page.select('.user-list-item')[0].text) == (
|
||||
'Test User (you) '
|
||||
'Can Add new alerts and templates '
|
||||
'Can Add and edit templates '
|
||||
'Can Add new alerts '
|
||||
'Can Approve alerts'
|
||||
)
|
||||
assert normalize_spaces(page.select('.user-list-item')[1].text) == (
|
||||
'Test User With Permissions (you) '
|
||||
'Cannot Add new alerts and templates '
|
||||
'Cannot Add and edit templates '
|
||||
'Cannot Add new alerts '
|
||||
'Cannot Approve alerts'
|
||||
)
|
||||
|
||||
@@ -326,6 +328,7 @@ def test_broadcast_service_only_shows_relevant_permissions(
|
||||
assert [
|
||||
(field['name'], field['value']) for field in page.select('input[type=checkbox]')
|
||||
] == [
|
||||
('permissions_field', 'manage_templates'),
|
||||
('permissions_field', 'create_broadcasts'),
|
||||
('permissions_field', 'approve_broadcasts'),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user