diff options
author | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-07 01:14:10 +0100 |
---|---|---|
committer | James Edwards-Jones <jedwardsjones@gitlab.com> | 2017-04-07 01:17:38 +0100 |
commit | 9db87fce130bdcb4831631c46fbb9d5717472af2 (patch) | |
tree | 63ee8dec19816edb6d4a3f71a9c6ce61f0e71779 /app | |
parent | 8a5ca1121b090fe813144adf4428e7cb656b65d3 (diff) | |
download | gitlab-ce-9db87fce130bdcb4831631c46fbb9d5717472af2.tar.gz |
Protected tags changes from backend maintainer review
Diffstat (limited to 'app')
-rw-r--r-- | app/models/concerns/protected_ref_access.rb | 2 | ||||
-rw-r--r-- | app/models/protected_ref_matcher.rb | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/models/concerns/protected_ref_access.rb b/app/models/concerns/protected_ref_access.rb index 0c7e5157cdf..c4f158e569a 100644 --- a/app/models/concerns/protected_ref_access.rb +++ b/app/models/concerns/protected_ref_access.rb @@ -11,7 +11,7 @@ module ProtectedRefAccess end def check_access(user) - return true if user.is_admin? + return true if user.admin? project.team.max_member_access(user.id) >= access_level end diff --git a/app/models/protected_ref_matcher.rb b/app/models/protected_ref_matcher.rb index 83f44240259..d970f2b01fc 100644 --- a/app/models/protected_ref_matcher.rb +++ b/app/models/protected_ref_matcher.rb @@ -4,7 +4,7 @@ class ProtectedRefMatcher end # 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. # # This method optionally takes in a list of `protected_refs` to search @@ -38,6 +38,8 @@ class ProtectedRefMatcher end def wildcard_match?(ref_name) + return false unless wildcard? + wildcard_regex === ref_name end |