mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user