diff options
Diffstat (limited to 'app/models/environment_status.rb')
-rw-r--r-- | app/models/environment_status.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/environment_status.rb b/app/models/environment_status.rb index d06d0a99948..58c57a60f9d 100644 --- a/app/models/environment_status.rb +++ b/app/models/environment_status.rb @@ -100,11 +100,14 @@ class EnvironmentStatus def self.build_environments_status(mr, user, pipeline) return [] unless pipeline - pipeline.environments_in_self_and_project_descendants.includes(:project).available.map do |environment| + environments = pipeline.environments_in_self_and_project_descendants.includes(:project) + environments = environments.available if Feature.disabled?(:review_apps_redeploy_mr_widget, mr.project) + environments.map do |environment| next unless Ability.allowed?(user, :read_environment, environment) EnvironmentStatus.new(pipeline.project, environment, mr, pipeline.sha) end.compact end + private_class_method :build_environments_status end |