Allow setting of caseworking on a user

This commit changes the form that the user sees when inviting or editing
another user, if the service has the ‘caseworking’ permission set.

This will allow creating a new type of user, one who only has the
`send_messages` permission, without the `view_activity` permission.

We are doing this because we think there are a number of services with a
lot of users who don’t need to see the dashboard, or the other team
members, and that we can make a simpler interface for these users.
This commit is contained in:
Chris Hill-Scott
2018-06-12 14:29:47 +01:00
parent d952b5ca3c
commit f4d2958d58
13 changed files with 436 additions and 47 deletions

View File

@@ -1161,6 +1161,32 @@ def active_user_with_permissions(fake_uuid):
return user
@pytest.fixture(scope='function')
def active_caseworking_user(fake_uuid):
from app.notify_client.user_api_client import User
user_data = {
'id': fake_uuid,
'name': 'Test User',
'password': 'somepassword',
'password_changed_at': str(datetime.utcnow()),
'email_address': 'caseworker@example.gov.uk',
'mobile_number': '07700 900762',
'state': 'active',
'failed_login_count': 0,
'permissions': {SERVICE_ONE_ID: [
'send_texts',
'send_emails',
'send_letters',
]},
'platform_admin': False,
'auth_type': 'sms_auth',
'organisations': [],
}
user = User(user_data)
return user
@pytest.fixture(scope='function')
def active_user_no_mobile(fake_uuid):
from app.notify_client.user_api_client import User
@@ -2046,7 +2072,7 @@ def sample_invite(mocker, service_one, status='pending'):
from_user = service_one['users'][0]
email_address = 'invited_user@test.gov.uk'
service_id = service_one['id']
permissions = 'send_messages,manage_service,manage_api_keys'
permissions = 'view_activity,send_messages,manage_service,manage_api_keys'
created_at = str(datetime.utcnow())
auth_type = 'sms_auth'