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
Jérome Perrin
gitlab-ce
Commits
d85471ac
Commit
d85471ac
authored
Apr 04, 2017
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed UserAccess#can_create_tag? after create_access_levels rename
parent
07d7d8e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
app/models/concerns/protected_ref.rb
app/models/concerns/protected_ref.rb
+2
-2
lib/gitlab/user_access.rb
lib/gitlab/user_access.rb
+1
-1
No files found.
app/models/concerns/protected_ref.rb
View file @
d85471ac
...
...
@@ -8,7 +8,7 @@ module ProtectedRef
delegate
:matching
,
:matches?
,
:wildcard?
,
to: :ref_matcher
def
self
.
protected_ref_accessible_to?
(
ref
,
user
,
action:
:push
)
def
self
.
protected_ref_accessible_to?
(
ref
,
user
,
action
:)
access_levels_for_ref
(
ref
,
action:
action
).
any?
do
|
access_level
|
access_level
.
check_access
(
user
)
end
...
...
@@ -20,7 +20,7 @@ module ProtectedRef
end
end
def
self
.
access_levels_for_ref
(
ref
,
action:
:push
)
def
self
.
access_levels_for_ref
(
ref
,
action
:)
self
.
matching
(
ref
).
map
(
&
:"
#{
action
}
_access_levels"
).
flatten
end
...
...
lib/gitlab/user_access.rb
View file @
d85471ac
...
...
@@ -32,7 +32,7 @@ module Gitlab
return
false
unless
can_access_git?
if
ProtectedTag
.
protected?
(
project
,
ref
)
project
.
protected_tags
.
protected_ref_accessible_to?
(
ref
,
user
)
project
.
protected_tags
.
protected_ref_accessible_to?
(
ref
,
user
,
action: :create
)
else
user
.
can?
(
:push_code
,
project
)
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