diff --git a/app/models/user.rb b/app/models/user.rb index 9825515bb..14483334e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -15,6 +15,10 @@ def gds_editor? permissions.include?("GDS Editor") end + def site_manager? + permissions.include?("Site Manager") + end + def can_edit_sites @can_edit_sites ||= {} end diff --git a/features/step_definitions/authentication_steps.rb b/features/step_definitions/authentication_steps.rb index f4eac4ab4..26283338a 100644 --- a/features/step_definitions/authentication_steps.rb +++ b/features/step_definitions/authentication_steps.rb @@ -28,3 +28,7 @@ Given(/^I have logged in as a member of another organisation$/) do GDS::SSO.test_user = create(:user, organisation_content_id: SecureRandom.uuid) end + +Given(/^I have logged in as a Site Manager$/) do + GDS::SSO.test_user = create(:site_manager) +end diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 2535e81e4..b83d59944 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -11,5 +11,9 @@ factory :admin do permissions { ["signin", "GDS Editor", "admin"] } end + + factory :site_manager do + permissions { ["signin", "Site Manager"] } + end end end