summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobin Bobbitt <ryehle@us.ibm.com>2017-08-04 09:17:20 -0400
committerRobin Bobbitt <ryehle@us.ibm.com>2017-08-21 18:13:32 -0400
commit62ef67acc3a8d260aa3e641b350aaecf8d60f1aa (patch)
tree9d120306e3a551f85e7ab0ac2efbbf1684899139 /app
parente6d87021f31839395fdbdedc36613a57fb771375 (diff)
downloadgitlab-ce-62ef67acc3a8d260aa3e641b350aaecf8d60f1aa.tar.gz
Hide read_registry scope when registry is disabled on instance
Diffstat (limited to 'app')
-rw-r--r--app/models/personal_access_token.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/personal_access_token.rb b/app/models/personal_access_token.rb
index 654be927ed8..ec0ebe4d353 100644
--- a/app/models/personal_access_token.rb
+++ b/app/models/personal_access_token.rb
@@ -28,7 +28,7 @@ class PersonalAccessToken < ActiveRecord::Base
protected
def validate_scopes
- unless scopes.all? { |scope| Gitlab::Auth::AVAILABLE_SCOPES.include?(scope.to_sym) }
+ unless revoked || scopes.all? { |scope| Gitlab::Auth::AVAILABLE_SCOPES.include?(scope.to_sym) }
errors.add :scopes, "can only contain available scopes"
end
end