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-06-01 09:08:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-06-01 09:08:03 +0300
commit8f535d9082bb0f10f2ef6b9133dbc77691ace4db (patch)
tree5e8df6512d9c5a5fee8e499b10e5b0817799d4aa /lib/api/helpers.rb
parent4346c3ae00a177d8afe73a898514b0edeb43e07d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 83641e824ae..98f6733a6f2 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -202,6 +202,7 @@ module API
not_found!('Namespace')
end
+ # find_namespace returns the namespace regardless of user access level on the namespace
# rubocop: disable CodeReuse/ActiveRecord
def find_namespace(id)
if id.to_s =~ INTEGER_ID_REGEX
@@ -212,6 +213,8 @@ module API
end
# rubocop: enable CodeReuse/ActiveRecord
+ # find_namespace! returns the namespace if the current user can read the given namespace
+ # Otherwise, returns a not_found! error
def find_namespace!(id)
check_namespace_access(find_namespace(id))
end