Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMayra Cabrera <mcabrera@gitlab.com>2018-03-30 01:56:35 +0300
committerMayra Cabrera <mcabrera@gitlab.com>2018-04-07 05:20:16 +0300
commit370fc05da7f95bf6621867a71d51493cf3899e25 (patch)
tree040f676c8c6ccf04d5ebfdbbe064a844affd63f5 /app/models/deploy_token.rb
parentdb18993f652425b72c4b854e18a002e0ec44b196 (diff)
Implement 'read_repo' for DeployTokens
This will allow to download a repo using the token from the DeployToken
Diffstat (limited to 'app/models/deploy_token.rb')
-rw-r--r--app/models/deploy_token.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/deploy_token.rb b/app/models/deploy_token.rb
index 185bd806b18..089b4343f41 100644
--- a/app/models/deploy_token.rb
+++ b/app/models/deploy_token.rb
@@ -22,4 +22,12 @@ class DeployToken < ActiveRecord::Base
def self.redis_shared_state_key(user_id)
"gitlab:personal_access_token:#{user_id}"
end
+
+ def active?
+ !revoked
+ end
+
+ def username
+ User.ghost.username
+ end
end