Hide ‘request to go live’ from API only users

Users who have the ‘manage API keys’ permission can see the settings
page. But they don’t have permission to request to go live.

At the moment they can still see the link, though clicking it gives them
a 403 error. This commit changes it so that they can’t see the link, and
tells them who they should speak to about going live (their manager).
This commit is contained in:
Chris Hill-Scott
2018-02-22 13:13:57 +00:00
parent 24f6b7246d
commit 103a36a5da
3 changed files with 72 additions and 12 deletions

View File

@@ -1261,6 +1261,31 @@ def active_user_no_api_key_permission(fake_uuid):
return user
@pytest.fixture
def active_user_no_settings_permission(fake_uuid):
from app.notify_client.user_api_client import User
user_data = {
'id': fake_uuid,
'name': 'Test User With Permissions',
'password': 'somepassword',
'password_changed_at': str(datetime.utcnow()),
'email_address': 'test@user.gov.uk',
'mobile_number': '07700 900762',
'state': 'active',
'failed_login_count': 0,
'permissions': {SERVICE_ONE_ID: [
'manage_templates',
'manage_api_keys',
'view_activity',
]},
'platform_admin': False,
'auth_type': 'sms_auth'
}
user = User(user_data)
return user
@pytest.fixture(scope='function')
def api_user_locked(fake_uuid):
from app.notify_client.user_api_client import User