diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 80c8afb..631381b 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -49,6 +49,11 @@ en: solved_event: name: "Solved Event" details: "When a user marks a post as the accepted or unaccepted answer." + api: + scopes: + descriptions: + solved: + answer: Accept/Unaccept a solution. discourse_automation: triggerables: diff --git a/plugin.rb b/plugin.rb index 26df8f6..834b296 100644 --- a/plugin.rb +++ b/plugin.rb @@ -249,6 +249,11 @@ SQL Discourse::Application.routes.append { mount ::DiscourseSolved::Engine, at: "solution" } + add_api_key_scope( + :solved, + { answer: { actions: %w[discourse_solved/answer#accept discourse_solved/answer#unaccept] } }, + ) + topic_view_post_custom_fields_allowlister { ["is_accepted_answer"] } def get_schema_text(post)