mirror of
https://github.com/discourse/discourse.git
synced 2025-04-02 03:45:59 +08:00
FEATURE: Adding some more api scopes (#20420)
Adds api scopes for - deleting a topic - deleting a post - listing tags
This commit is contained in:
parent
a433b30650
commit
5dbdcb3f23
@ -31,6 +31,9 @@ class ApiKeyScope < ActiveRecord::Base
|
|||||||
actions: %w[topics#update topics#status],
|
actions: %w[topics#update topics#status],
|
||||||
params: %i[topic_id category_id],
|
params: %i[topic_id category_id],
|
||||||
},
|
},
|
||||||
|
delete: {
|
||||||
|
actions: %w[topics#destroy],
|
||||||
|
},
|
||||||
read: {
|
read: {
|
||||||
actions: %w[topics#show topics#feed topics#posts],
|
actions: %w[topics#show topics#feed topics#posts],
|
||||||
params: %i[topic_id],
|
params: %i[topic_id],
|
||||||
@ -55,6 +58,14 @@ class ApiKeyScope < ActiveRecord::Base
|
|||||||
actions: %w[posts#update],
|
actions: %w[posts#update],
|
||||||
params: %i[id],
|
params: %i[id],
|
||||||
},
|
},
|
||||||
|
delete: {
|
||||||
|
actions: %w[posts#destroy],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
tags: {
|
||||||
|
list: {
|
||||||
|
actions: %w[tags#index],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
categories: {
|
categories: {
|
||||||
list: {
|
list: {
|
||||||
|
@ -4699,10 +4699,14 @@ en:
|
|||||||
read: Read a topic or a specific post in it. RSS is also supported.
|
read: Read a topic or a specific post in it. RSS is also supported.
|
||||||
write: Create a new topic or post to an existing one.
|
write: Create a new topic or post to an existing one.
|
||||||
update: Update a topic. Change the title, category, tags, status, archetype, featured_link etc.
|
update: Update a topic. Change the title, category, tags, status, archetype, featured_link etc.
|
||||||
|
delete: Delete a topic.
|
||||||
read_lists: Read topic lists like top, new, latest, etc. RSS is also supported.
|
read_lists: Read topic lists like top, new, latest, etc. RSS is also supported.
|
||||||
status: "Update a topic's status. Status: closed, archive, visisble, pinned. Enabled: true, false. Specify a category_id here and in the request payload to only allow status changes on topics in that category."
|
status: "Update a topic's status. Status: closed, archive, visisble, pinned. Enabled: true, false. Specify a category_id here and in the request payload to only allow status changes on topics in that category."
|
||||||
posts:
|
posts:
|
||||||
edit: Edit any post or a specific one.
|
edit: Edit any post or a specific one.
|
||||||
|
delete: Delete a post.
|
||||||
|
tags:
|
||||||
|
list: List tags.
|
||||||
categories:
|
categories:
|
||||||
list: Get a list of categories.
|
list: Get a list of categories.
|
||||||
show: Get a single category by id.
|
show: Get a single category by id.
|
||||||
|
@ -423,6 +423,7 @@ RSpec.describe Admin::ApiController do
|
|||||||
"users",
|
"users",
|
||||||
"email",
|
"email",
|
||||||
"posts",
|
"posts",
|
||||||
|
"tags",
|
||||||
"uploads",
|
"uploads",
|
||||||
"user_status",
|
"user_status",
|
||||||
"global",
|
"global",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user