diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-06-28 07:12:23 +0000 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-06-29 06:15:57 +0000 |
commit | b8ec1f4201c74c500e4f7010b238c7920599da7a (patch) | |
tree | f13e0aab941b8ff209716315a4d21626db878373 /lib/api/api_guard.rb | |
parent | c1fcd730cc9dbee5b41ce2a6a12f8d84416b1a4a (diff) | |
download | gitlab-ce-b8ec1f4201c74c500e4f7010b238c7920599da7a.tar.gz |
Extract a `Gitlab::Scope` class.
- To represent an authorization scope, such as `api` or `read_user`
- This is a better abstraction than the hash we were previously using.
Diffstat (limited to 'lib/api/api_guard.rb')
-rw-r--r-- | lib/api/api_guard.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb index 56f6da57555..0d2d71e336a 100644 --- a/lib/api/api_guard.rb +++ b/lib/api/api_guard.rb @@ -31,7 +31,7 @@ module API # the scopes are all aggregated. def allow_access_with_scope(scopes, options = {}) Array(scopes).each do |scope| - allowed_scopes << OpenStruct.new(name: scope.to_sym, if: options[:if]) + allowed_scopes << Scope.new(scope, options) end end |