diff options
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 3 |
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 |