summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 00:09:57 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-14 00:09:57 +0000
commit9398d718d92a40a0a917040645a55dea51467a91 (patch)
treece1242c69221f1e6abd701439631cf6e6d1b948d /app/models
parent602ea42669779ec431bcaeb41fd95e079b1a7021 (diff)
downloadgitlab-ce-9398d718d92a40a0a917040645a55dea51467a91.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models')
-rw-r--r--app/models/deploy_token.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/deploy_token.rb b/app/models/deploy_token.rb
index a9844f627b7..69245710f01 100644
--- a/app/models/deploy_token.rb
+++ b/app/models/deploy_token.rb
@@ -7,7 +7,7 @@ class DeployToken < ApplicationRecord
include Gitlab::Utils::StrongMemoize
add_authentication_token_field :token, encrypted: :optional
- AVAILABLE_SCOPES = %i(read_repository read_registry).freeze
+ AVAILABLE_SCOPES = %i(read_repository read_registry write_registry).freeze
GITLAB_DEPLOY_TOKEN_NAME = 'gitlab-deploy-token'
default_value_for(:expires_at) { Forever.date }
@@ -105,7 +105,7 @@ class DeployToken < ApplicationRecord
end
def ensure_at_least_one_scope
- errors.add(:base, _("Scopes can't be blank")) unless read_repository || read_registry
+ errors.add(:base, _("Scopes can't be blank")) unless read_repository || read_registry || write_registry
end
def default_username