diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-10-30 18:49:46 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-11-02 11:39:03 +0100 |
commit | b7c8f7d76d0b2b33486c962d13efb7f496d44ec2 (patch) | |
tree | e81d96c82b7a325250b4f3b5d1e566dbef4aac5c /app | |
parent | a6c462b28c920704661463b562dabbf9b8cb1b17 (diff) | |
download | gitlab-ce-b7c8f7d76d0b2b33486c962d13efb7f496d44ec2.tar.gz |
Update specs for sudo behavior
Diffstat (limited to 'app')
-rw-r--r-- | app/models/oauth_access_token.rb | 10 |
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 |