DEV: Move UserApiKey scopes to dedicated table (#10704)

This has no functional impact yet, but it is the first step in adding more granular scopes to UserApiKeys
This commit is contained in:
David Taylor
2020-09-29 10:57:48 +01:00
committed by GitHub
parent 91ac70a32d
commit 1ba9b34b03
11 changed files with 98 additions and 20 deletions

View File

@ -307,7 +307,7 @@ class Auth::DefaultCurrentUserProvider
protected
def lookup_user_api_user_and_update_key(user_api_key, client_id)
if api_key = UserApiKey.active.with_key(user_api_key).includes(:user).first
if api_key = UserApiKey.active.with_key(user_api_key).includes(:user, :scopes).first
unless api_key.allow?(@env)
raise Discourse::InvalidAccess
end