Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-17 19:05:49 +0300
commit43a25d93ebdabea52f99b05e15b06250cd8f07d7 (patch)
treedceebdc68925362117480a5d672bcff122fb625b /lib/gitlab/git_access_design.rb
parent20c84b99005abd1c82101dfeff264ac50d2df211 (diff)
Add latest changes from gitlab-org/gitlab@16-0-stable-eev16.0.0-rc42
Diffstat (limited to 'lib/gitlab/git_access_design.rb')
-rw-r--r--lib/gitlab/git_access_design.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/gitlab/git_access_design.rb b/lib/gitlab/git_access_design.rb
index bf89c01305a..fb8df0d217a 100644
--- a/lib/gitlab/git_access_design.rb
+++ b/lib/gitlab/git_access_design.rb
@@ -4,6 +4,23 @@ module Gitlab
class GitAccessDesign < GitAccess
extend ::Gitlab::Utils::Override
+ # TODO Re-factor so that correct container is passed to the constructor
+ # and this method can be removed from here
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/409454
+ def initialize(
+ actor, container, protocol, authentication_abilities:, repository_path: nil, redirected_path: nil,
+ auth_result_type: nil)
+ super(
+ actor,
+ select_container(container),
+ protocol,
+ authentication_abilities: authentication_abilities,
+ repository_path: repository_path,
+ redirected_path: redirected_path,
+ auth_result_type: auth_result_type
+ )
+ end
+
def check(_cmd, _changes)
check_protocol!
check_can_create_design!
@@ -18,6 +35,10 @@ module Gitlab
private
+ def select_container(container)
+ container.is_a?(::DesignManagement::Repository) ? container.project : container
+ end
+
def check_protocol!
if protocol != 'web'
raise ::Gitlab::GitAccess::ForbiddenError, "Designs are only accessible using the web interface"