Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
5c263007d23f
Commit
ff2713a5
authored
Apr 03, 2017
by
James Edwards-Jones
Browse files
Fix typos in ProtectedRef concern and whitespace detected by rubocop
parent
c46b641bd4f7
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/controllers/projects/protected_branches_controller.rb
View file @
5c263007
class
Projects::ProtectedBranchesController
<
Projects
::
ProtectedRefsController
protected
def
protected_ref
...
...
app/controllers/projects/protected_tags_controller.rb
View file @
5c263007
class
Projects::ProtectedTagsController
<
Projects
::
ProtectedRefsController
protected
def
protected_ref
...
...
app/controllers/projects/settings/repository_controller.rb
View file @
5c263007
...
...
@@ -19,7 +19,6 @@ def define_protected_refs
load_gon_index
end
def
access_levels_options
#TODO: consider protected tags
#TODO: Refactor ProtectedBranch::PushAccessLevel so it doesn't mention branches
...
...
app/models/concerns/protected_ref.rb
View file @
5c263007
...
...
@@ -9,13 +9,13 @@ module ProtectedRef
delegate
:matching
,
:matches?
,
:wildcard?
,
to: :ref_matcher
def
self
.
matching_refs_accesible_to
(
ref
,
user
,
action: :push
)
access_levels_for_ref
(
ref
,
action
).
any?
do
|
access_level
|
access_levels_for_ref
(
ref
,
action:
action
).
any?
do
|
access_level
|
access_level
.
check_access
(
user
)
end
end
def
self
.
access_levels_for_ref
(
ref
,
action: :push
)
self
.
matching
(
ref
).
map
(
&
:"
@
#{
action
}
_access_levels"
).
flatten
self
.
matching
(
ref
).
map
(
&
:"
#{
action
}
_access_levels"
).
flatten
end
def
self
.
matching
(
ref_name
,
protected_refs:
nil
)
...
...
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