mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 16:13:44 +08:00
14 lines
312 B
Ruby
14 lines
312 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class ApiKeyScopeSerializer < ApplicationSerializer
|
||
|
|
||
|
attributes :resource,
|
||
|
:action,
|
||
|
:parameters,
|
||
|
:allowed_parameters
|
||
|
|
||
|
def parameters
|
||
|
ApiKeyScope.scope_mappings.dig(object.resource.to_sym, object.action.to_sym, :params).to_a
|
||
|
end
|
||
|
end
|