mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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:
@@ -470,7 +470,8 @@ class PostAlerter
|
||||
|
||||
if SiteSetting.allow_user_api_key_scopes.split("|").include?("push") && SiteSetting.allowed_user_api_push_urls.present?
|
||||
clients = user.user_api_keys
|
||||
.where("('push' = ANY(scopes) OR 'notifications' = ANY(scopes))")
|
||||
.joins(:scopes)
|
||||
.where("user_api_key_scopes.name IN ('push', 'notifications')")
|
||||
.where("push_url IS NOT NULL AND push_url <> ''")
|
||||
.where("position(push_url IN ?) > 0", SiteSetting.allowed_user_api_push_urls)
|
||||
.where("revoked_at IS NULL")
|
||||
|
||||
Reference in New Issue
Block a user