Skip to content

Commit 65a9ccf

Browse files
FEATURE: Add API Scopes (#228)
Adds a single API scope for accepting or unaccepting a solution.
1 parent 8a4dadd commit 65a9ccf

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

config/locales/client.en.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ en:
4949
solved_event:
5050
name: "Solved Event"
5151
details: "When a user marks a post as the accepted or unaccepted answer."
52+
api:
53+
scopes:
54+
descriptions:
55+
solved:
56+
answer: Accept/Unaccept a solution.
5257

5358
discourse_automation:
5459
triggerables:

plugin.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ def limit_accepts
249249

250250
Discourse::Application.routes.append { mount ::DiscourseSolved::Engine, at: "solution" }
251251

252+
add_api_key_scope(
253+
:solved,
254+
{ answer: { actions: %w[discourse_solved/answer#accept discourse_solved/answer#unaccept] } },
255+
)
256+
252257
topic_view_post_custom_fields_allowlister { ["is_accepted_answer"] }
253258

254259
def get_schema_text(post)

0 commit comments

Comments
 (0)