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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
d7eee733
Commit
d7eee733
authored
May 23, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract and memoize `user_access`
Because it is sometimes never used.
parent
0e3cfc75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+9
-6
No files found.
lib/gitlab/git_access.rb
View file @
d7eee733
...
@@ -22,18 +22,13 @@ module Gitlab
...
@@ -22,18 +22,13 @@ module Gitlab
PUSH_COMMANDS
=
%w{ git-receive-pack }
.
freeze
PUSH_COMMANDS
=
%w{ git-receive-pack }
.
freeze
ALL_COMMANDS
=
DOWNLOAD_COMMANDS
+
PUSH_COMMANDS
ALL_COMMANDS
=
DOWNLOAD_COMMANDS
+
PUSH_COMMANDS
attr_reader
:actor
,
:project
,
:protocol
,
:
user_access
,
:
authentication_abilities
attr_reader
:actor
,
:project
,
:protocol
,
:authentication_abilities
def
initialize
(
actor
,
project
,
protocol
,
authentication_abilities
:)
def
initialize
(
actor
,
project
,
protocol
,
authentication_abilities
:)
@actor
=
actor
@actor
=
actor
@project
=
project
@project
=
project
@protocol
=
protocol
@protocol
=
protocol
@authentication_abilities
=
authentication_abilities
@authentication_abilities
=
authentication_abilities
@user_access
=
if
ci?
CiAccess
.
new
else
UserAccess
.
new
(
user
,
project:
project
)
end
end
end
def
check
(
cmd
,
changes
)
def
check
(
cmd
,
changes
)
...
@@ -244,5 +239,13 @@ module Gitlab
...
@@ -244,5 +239,13 @@ module Gitlab
nil
nil
end
end
end
end
def
user_access
@user_access
||=
if
ci?
CiAccess
.
new
else
UserAccess
.
new
(
user
,
project:
project
)
end
end
end
end
end
end
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