diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /app/controllers/concerns | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'app/controllers/concerns')
-rw-r--r-- | app/controllers/concerns/bizible_csp.rb | 15 | ||||
-rw-r--r-- | app/controllers/concerns/integrations/actions.rb | 3 | ||||
-rw-r--r-- | app/controllers/concerns/integrations/params.rb | 1 | ||||
-rw-r--r-- | app/controllers/concerns/issuable_actions.rb | 5 | ||||
-rw-r--r-- | app/controllers/concerns/multiple_boards_actions.rb | 2 | ||||
-rw-r--r-- | app/controllers/concerns/planning_hierarchy.rb | 15 | ||||
-rw-r--r-- | app/controllers/concerns/uploads_actions.rb | 8 |
7 files changed, 44 insertions, 5 deletions
diff --git a/app/controllers/concerns/bizible_csp.rb b/app/controllers/concerns/bizible_csp.rb new file mode 100644 index 00000000000..521f3127759 --- /dev/null +++ b/app/controllers/concerns/bizible_csp.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module BizibleCSP + extend ActiveSupport::Concern + + included do + content_security_policy do |policy| + next unless helpers.bizible_enabled? || policy.directives.present? + + default_script_src = policy.directives['script-src'] || policy.directives['default-src'] + script_src_values = Array.wrap(default_script_src) | ["'unsafe-eval'", 'https://cdn.bizible.com/scripts/bizible.js'] + policy.script_src(*script_src_values) + end + end +end diff --git a/app/controllers/concerns/integrations/actions.rb b/app/controllers/concerns/integrations/actions.rb index f6e98c25b72..1f788860c8f 100644 --- a/app/controllers/concerns/integrations/actions.rb +++ b/app/controllers/concerns/integrations/actions.rb @@ -8,9 +8,6 @@ module Integrations::Actions include IntegrationsHelper before_action :integration, only: [:edit, :update, :overrides, :test] - before_action do - push_frontend_feature_flag(:vue_integration_form, current_user, default_enabled: :yaml) - end urgency :low, [:test] end diff --git a/app/controllers/concerns/integrations/params.rb b/app/controllers/concerns/integrations/params.rb index 945540d1f8c..80acb369cb2 100644 --- a/app/controllers/concerns/integrations/params.rb +++ b/app/controllers/concerns/integrations/params.rb @@ -30,6 +30,7 @@ module Integrations :datadog_site, :datadog_env, :datadog_service, + :datadog_tags, :default_irc_uri, :device, :disable_diffs, diff --git a/app/controllers/concerns/issuable_actions.rb b/app/controllers/concerns/issuable_actions.rb index bac9732018c..eae087bca4d 100644 --- a/app/controllers/concerns/issuable_actions.rb +++ b/app/controllers/concerns/issuable_actions.rb @@ -17,7 +17,10 @@ module IssuableActions def show respond_to do |format| format.html do - @show_crm_contacts = issuable.is_a?(Issue) && can?(current_user, :read_crm_contact, issuable.project.group) # rubocop:disable Gitlab/ModuleWithInstanceVariables + @show_crm_contacts = issuable.is_a?(Issue) && # rubocop:disable Gitlab/ModuleWithInstanceVariables + can?(current_user, :read_crm_contact, issuable.project.group) && + CustomerRelations::Contact.exists_for_group?(issuable.project.group) + @issuable_sidebar = serializer.represent(issuable, serializer: 'sidebar') # rubocop:disable Gitlab/ModuleWithInstanceVariables render 'show' end diff --git a/app/controllers/concerns/multiple_boards_actions.rb b/app/controllers/concerns/multiple_boards_actions.rb index 85bb73463db..685c93fc2a2 100644 --- a/app/controllers/concerns/multiple_boards_actions.rb +++ b/app/controllers/concerns/multiple_boards_actions.rb @@ -14,7 +14,7 @@ module MultipleBoardsActions end def recent - recent_visits = ::Boards::VisitsFinder.new(parent, current_user).latest(4) + recent_visits = ::Boards::VisitsFinder.new(parent, current_user).latest(Board::RECENT_BOARDS_SIZE) recent_boards = recent_visits.map(&:board) render json: serialize_as_json(recent_boards) diff --git a/app/controllers/concerns/planning_hierarchy.rb b/app/controllers/concerns/planning_hierarchy.rb new file mode 100644 index 00000000000..5df838bc183 --- /dev/null +++ b/app/controllers/concerns/planning_hierarchy.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module PlanningHierarchy + extend ActiveSupport::Concern + + # rubocop:disable Gitlab/ModuleWithInstanceVariables + def planning_hierarchy + return access_denied! unless can?(current_user, :read_planning_hierarchy, @project) + + render 'shared/planning_hierarchy' + end + # rubocop:enable Gitlab/ModuleWithInstanceVariables +end + +PlanningHierarchy.prepend_mod_with('PlanningHierarchy') diff --git a/app/controllers/concerns/uploads_actions.rb b/app/controllers/concerns/uploads_actions.rb index f489de42864..e1bfe92f61b 100644 --- a/app/controllers/concerns/uploads_actions.rb +++ b/app/controllers/concerns/uploads_actions.rb @@ -142,6 +142,14 @@ module UploadsActions uploader && uploader.exists? && uploader.embeddable? end + def bypass_auth_checks_on_uploads? + if ::Feature.enabled?(:enforce_auth_checks_on_uploads, default_enabled: :yaml) + false + else + action_name == 'show' && embeddable? + end + end + def find_model nil end |