mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Allow platform admins to cancel broadcasts.
Do not allow platform admins to: - create broadcasts - approve broadcasts - reject broadcasts that is, unless they have a send_messages permission for a given service. This is so platform admins have the minimum permissions necessary to cancel a broadcast that might have been sent out accidentally.
This commit is contained in:
@@ -1108,6 +1108,31 @@ def platform_admin_user(fake_uuid):
|
||||
return user_data
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def platform_admin_user_no_service_permissions():
|
||||
"""
|
||||
this fixture is for situations where we want to test that platform admin can access
|
||||
an endpoint even though they have no explicit permissions for that service.
|
||||
"""
|
||||
user_data = {'id': uuid4(),
|
||||
'name': 'Platform admin user no service permissions',
|
||||
'password': 'somepassword',
|
||||
'email_address': 'platform2@admin.gov.uk',
|
||||
'mobile_number': '07700 900763',
|
||||
'state': 'active',
|
||||
'failed_login_count': 0,
|
||||
'permissions': {},
|
||||
'platform_admin': True,
|
||||
'auth_type': 'sms_auth',
|
||||
'password_changed_at': str(datetime.utcnow()),
|
||||
'services': [],
|
||||
'organisations': [],
|
||||
'current_session_id': None,
|
||||
'logged_in_at': None,
|
||||
}
|
||||
return user_data
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
def api_user_active(fake_uuid):
|
||||
user_data = {'id': fake_uuid,
|
||||
|
||||
Reference in New Issue
Block a user