Commit 9db87fce authored by James Edwards-Jones's avatar James Edwards-Jones

Protected tags changes from backend maintainer review

parent 8a5ca112
...@@ -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
......
...@@ -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 realizes all records from the scope built up so far, and does # This checks 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
......
--- ---
title: Protected Tags feature title: Tags can be protected, restricting creation of matching tags by user role
merge_request: 10356 merge_request: 10356
author: author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment