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
Boxiang Sun
gitlab-ce
Commits
9db87fce
Commit
9db87fce
authored
Apr 07, 2017
by
James Edwards-Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protected tags changes from backend maintainer review
parent
8a5ca112
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
app/models/concerns/protected_ref_access.rb
app/models/concerns/protected_ref_access.rb
+1
-1
app/models/protected_ref_matcher.rb
app/models/protected_ref_matcher.rb
+3
-1
changelogs/unreleased/18471-restrict-tag-pushes-protected-tags.yml
...s/unreleased/18471-restrict-tag-pushes-protected-tags.yml
+1
-1
No files found.
app/models/concerns/protected_ref_access.rb
View file @
9db87fce
...
@@ -11,7 +11,7 @@ module ProtectedRefAccess
...
@@ -11,7 +11,7 @@ module ProtectedRefAccess
end
end
def
check_access
(
user
)
def
check_access
(
user
)
return
true
if
user
.
is_
admin?
return
true
if
user
.
admin?
project
.
team
.
max_member_access
(
user
.
id
)
>=
access_level
project
.
team
.
max_member_access
(
user
.
id
)
>=
access_level
end
end
...
...
app/models/protected_ref_matcher.rb
View file @
9db87fce
...
@@ -4,7 +4,7 @@ class ProtectedRefMatcher
...
@@ -4,7 +4,7 @@ class ProtectedRefMatcher
end
end
# Returns all protected refs that match the given ref name.
# Returns all protected refs that match the given ref name.
# This
realize
s all records from the scope built up so far, and does
# This
check
s all records from the scope built up so far, and does
# _not_ return a relation.
# _not_ return a relation.
#
#
# This method optionally takes in a list of `protected_refs` to search
# This method optionally takes in a list of `protected_refs` to search
...
@@ -38,6 +38,8 @@ class ProtectedRefMatcher
...
@@ -38,6 +38,8 @@ class ProtectedRefMatcher
end
end
def
wildcard_match?
(
ref_name
)
def
wildcard_match?
(
ref_name
)
return
false
unless
wildcard?
wildcard_regex
===
ref_name
wildcard_regex
===
ref_name
end
end
...
...
changelogs/unreleased/18471-restrict-tag-pushes-protected-tags.yml
View file @
9db87fce
---
---
title
:
Protected Tags featur
e
title
:
Tags can be protected, restricting creation of matching tags by user rol
e
merge_request
:
10356
merge_request
:
10356
author
:
author
:
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