diff --git a/app/models/user.rb b/app/models/user.rb index e8b68bac3..cc47c07d7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -393,6 +393,7 @@ class User < ApplicationRecord def role_is_allowed_to_be_in_organisation?(override_organisation_id: nil) return true unless support? && FeatureToggle.support_organisation_allow_list.present? + FeatureToggle.support_organisation_allow_list.include?(override_organisation_id || organisation_id) end diff --git a/app/services/feature_toggle.rb b/app/services/feature_toggle.rb index 30151ad47..7404309f2 100644 --- a/app/services/feature_toggle.rb +++ b/app/services/feature_toggle.rb @@ -38,6 +38,6 @@ class FeatureToggle # IDs of organisations a user must be in to be allowed the support role # if nil this feature will be disabled def self.support_organisation_allow_list - return [1] if Rails.env.production? + [1] if Rails.env.production? end end