summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-10-30 18:49:46 +0100
committerDouwe Maan <douwe@selenight.nl>2017-11-02 11:39:03 +0100
commitb7c8f7d76d0b2b33486c962d13efb7f496d44ec2 (patch)
treee81d96c82b7a325250b4f3b5d1e566dbef4aac5c /app
parenta6c462b28c920704661463b562dabbf9b8cb1b17 (diff)
downloadgitlab-ce-b7c8f7d76d0b2b33486c962d13efb7f496d44ec2.tar.gz
Update specs for sudo behavior
Diffstat (limited to 'app')
-rw-r--r--app/models/oauth_access_token.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/models/oauth_access_token.rb b/app/models/oauth_access_token.rb
index f89e60ad9f4..e8595b13d6d 100644
--- a/app/models/oauth_access_token.rb
+++ b/app/models/oauth_access_token.rb
@@ -2,5 +2,13 @@ class OauthAccessToken < Doorkeeper::AccessToken
belongs_to :resource_owner, class_name: 'User'
belongs_to :application, class_name: 'Doorkeeper::Application'
- alias_method :user, :resource_owner
+ alias_attribute :user, :resource_owner
+
+ def scopes=(value)
+ if value.is_a?(Array)
+ super(Doorkeeper::OAuth::Scopes.from_array(value).to_s)
+ else
+ super
+ end
+ end
end