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:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-01-31 16:52:46 +0300
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-02-06 16:35:35 +0300
commit839829a7786dd163eccb470bf251211bfb90bd72 (patch)
treea30dd2d54dc1b20d9b5e5130b7f4bc5ce44c2723 /lib/gitlab/git_access.rb
parentdc229c076cdc0ef6e7f3f74f6e462c22880ff08c (diff)
Adds documentation for the feature
Diffstat (limited to 'lib/gitlab/git_access.rb')
-rw-r--r--lib/gitlab/git_access.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb
index 3d07e112e2b..84299dd5790 100644
--- a/lib/gitlab/git_access.rb
+++ b/lib/gitlab/git_access.rb
@@ -2,6 +2,8 @@
# class return an instance of `GitlabAccessStatus`
module Gitlab
class GitAccess
+ include Gitlab::Utils::StrongMemoize
+
UnauthorizedError = Class.new(StandardError)
NotFoundError = Class.new(StandardError)
ProjectCreationError = Class.new(StandardError)
@@ -239,9 +241,11 @@ module Gitlab
end
def can_create_project_in_namespace?(cmd)
- return false unless push?(cmd) && target_namespace && project.blank?
+ strong_memoize(:can_create_project_in_namespace) do
+ return false unless push?(cmd) && target_namespace && project.blank?
- user.can?(:create_projects, target_namespace)
+ user.can?(:create_projects, target_namespace)
+ end
end
def http?