mirror of
https://github.com/GSA/notifications-api.git
synced 2026-05-03 15:50:12 -04:00
Add flag to say if user is eligible for WebAuthn
Currently we have some data-driven roles to say who can use this feature. Adding a flag in the API means we can avoid API calls in the Admin app to determine the same. Allowing members of the GOV.UK Notify service to use the feature is a workaround, so we can avoid making someone a Platform Admin before they've protected their account with it.
This commit is contained in:
@@ -341,3 +341,17 @@ def test_template_folder_is_parent(sample_service):
|
||||
assert folders[0].is_parent_of(folders[4])
|
||||
assert folders[1].is_parent_of(folders[2])
|
||||
assert not folders[1].is_parent_of(folders[0])
|
||||
|
||||
|
||||
@pytest.mark.parametrize('is_platform_admin', (False, True))
|
||||
def test_user_can_use_webauthn_returns_false(sample_user, is_platform_admin):
|
||||
sample_user.platform_admin = is_platform_admin
|
||||
assert sample_user.can_use_webauthn == is_platform_admin
|
||||
|
||||
|
||||
def test_user_can_use_webauthn_if_in_broadcast_org(sample_broadcast_service):
|
||||
assert sample_broadcast_service.users[0].can_use_webauthn
|
||||
|
||||
|
||||
def test_user_can_use_webauthn_if_in_notify_team(notify_service):
|
||||
assert notify_service.users[0].can_use_webauthn
|
||||
|
||||
Reference in New Issue
Block a user