Relabel existing permissions

Since we have added a new, 5th permission the existing permissions
should be relabelled so that the five make sense as a coherent set.

We especially want to make sure that:
- the labels work against the checkboxes and against the tick/crosses on
  the manage users page (a long time ago this page was layed out
  differently so didn’t have space for full labels)
- there is no confusion between usage and reports

This commit also:
- re-adds a line about what all users can see (‘sent messages’) but
  continues to omit the additional bullet points about templates and
  team members (because we think this is clear enough from reading the
  permissions)
- refactors the `Form` subclass so that the content and order of the
  permissions only have to be defined once
- brings back the ‘permissions’ legend on the `fieldset`
This commit is contained in:
Chris Hill-Scott
2018-08-08 08:45:58 +01:00
parent 5108187cab
commit 347912876c
6 changed files with 76 additions and 75 deletions

View File

@@ -26,18 +26,18 @@ from tests.conftest import service_one as create_sample_service
(
'Test User (you) '
'Can See dashboard and reports '
'Can Send messages '
'Can Send messages using templates '
'Can Add and edit templates '
'Can Manage service '
'Can Access API keys'
'Can Manage settings, team members and usage '
'Can Manage API integration'
),
(
'ZZZZZZZZ zzzzzzz@example.gov.uk '
'Can See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Cant Add and edit templates '
'Cant Manage service '
'Cant Access API keys '
'Cant Manage settings, team members and usage '
'Cant Manage API integration '
'Edit permissions'
)
),
@@ -46,18 +46,18 @@ from tests.conftest import service_one as create_sample_service
(
'Test User With Empty Permissions (you) '
'Cant See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Cant Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
),
(
'ZZZZZZZZ zzzzzzz@example.gov.uk '
'Can See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Cant Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
),
),
(
@@ -65,18 +65,18 @@ from tests.conftest import service_one as create_sample_service
(
'Test User With Permissions (you) '
'Can See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Cant Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
),
(
'ZZZZZZZZ zzzzzzz@example.gov.uk '
'Can See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Cant Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
)
),
(
@@ -84,18 +84,18 @@ from tests.conftest import service_one as create_sample_service
(
'Test User With Permissions (you) '
'Can See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Can Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
),
(
'ZZZZZZZZ zzzzzzz@example.gov.uk '
'Can See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Cant Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
)
),
(
@@ -103,18 +103,18 @@ from tests.conftest import service_one as create_sample_service
(
'Test User With Permissions (you) '
'Can See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Can Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
),
(
'ZZZZZZZZ zzzzzzz@example.gov.uk '
'Can See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Cant Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
)
),
])
@@ -175,19 +175,19 @@ def test_should_show_caseworker_on_overview_page(
assert normalize_spaces(page.select('.user-list-item')[0].text) == (
'Test User With Permissions (you) '
'Can See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Cant Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
)
# [1:5] are invited users
assert normalize_spaces(page.select('.user-list-item')[6].text) == (
'Test User zzzzzzz@example.gov.uk '
'Cant See dashboard and reports '
'Can Send messages '
'Can Send messages using templates '
'Cant Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
)
@@ -606,20 +606,20 @@ def test_cancel_invited_user_cancels_user_invitations(
('pending', (
'invited_user@test.gov.uk (invited) '
'Can See dashboard and reports '
'Can Send messages '
'Can Send messages using templates '
'Cant Add and edit templates '
'Can Manage service '
'Can Access API keys '
'Can Manage settings, team members and usage '
'Can Manage API integration '
'Cancel invitation'
)),
('cancelled', (
'invited_user@test.gov.uk (cancelled invite) '
# all permissions are greyed out
'Cant See dashboard and reports '
'Cant Send messages '
'Cant Send messages using templates '
'Cant Add and edit templates '
'Cant Manage service '
'Cant Access API keys'
'Cant Manage settings, team members and usage '
'Cant Manage API integration'
)),
])
def test_manage_users_shows_invited_user(