Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Site manager permission #1385

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions features/step_definitions/authentication_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions spec/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@
factory :admin do
permissions { ["signin", "GDS Editor", "admin"] }
end

factory :site_manager do
permissions { ["signin", "Site Manager"] }
end
end
end