mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 21:49:37 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user