DEV: Introduce plugin API to contribute user api key scopes

This commit is contained in:
David Taylor
2020-10-09 14:52:48 +01:00
parent 23e5c605f6
commit b7c680853d
5 changed files with 61 additions and 7 deletions

View File

@ -17,7 +17,11 @@ class UserApiKeyScope < ActiveRecord::Base
}
def self.all_scopes
SCOPES
scopes = SCOPES
DiscoursePluginRegistry.user_api_key_scope_mappings.each do |mapping|
scopes = scopes.merge!(mapping)
end
scopes
end
def permits?(env)