Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7612db28
Commit
7612db28
authored
Apr 15, 2020
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace access to container in internal API
parent
a661d092
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
lib/api/helpers/internal_helpers.rb
lib/api/helpers/internal_helpers.rb
+13
-6
No files found.
lib/api/helpers/internal_helpers.rb
View file @
7612db28
...
...
@@ -3,7 +3,7 @@
module
API
module
Helpers
module
InternalHelpers
attr_reader
:redirected_path
,
:container
attr_reader
:redirected_path
delegate
:wiki?
,
to: :repo_type
...
...
@@ -11,15 +11,22 @@ module API
@actor
||=
Support
::
GitAccessActor
.
from_params
(
params
)
end
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def
repo_type
set_project
unless
defined?
(
@repo_type
)
# rubocop:disable Gitlab/ModuleWithInstanceVariables
@repo_type
# rubocop:disable Gitlab/ModuleWithInstanceVariables
parse_repo_path
unless
defined?
(
@repo_type
)
@repo_type
end
def
project
set_project
unless
defined?
(
@project
)
# rubocop:disable Gitlab/ModuleWithInstanceVariables
@project
# rubocop:disable Gitlab/ModuleWithInstanceVariables
parse_repo_path
unless
defined?
(
@project
)
@project
end
def
container
parse_repo_path
unless
defined?
(
@container
)
@container
end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
def
access_checker_for
(
actor
,
protocol
)
access_checker_klass
.
new
(
actor
.
key_or_user
,
container
,
protocol
,
...
...
@@ -79,7 +86,7 @@ module API
end
# rubocop:disable Gitlab/ModuleWithInstanceVariables
def
set_project
def
parse_repo_path
@container
,
@project
,
@repo_type
,
@redirected_path
=
if
params
[
:gl_repository
]
Gitlab
::
GlRepository
.
parse
(
params
[
:gl_repository
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment