FEATURE: Adding some more api scopes (#20420)

Adds api scopes for

- deleting a topic
- deleting a post
- listing tags
This commit is contained in:
Blake Erickson 2023-02-23 08:33:29 -07:00 committed by GitHub
parent a433b30650
commit 5dbdcb3f23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View File

@ -31,6 +31,9 @@ class ApiKeyScope < ActiveRecord::Base
actions: %w[topics#update topics#status],
params: %i[topic_id category_id],
},
delete: {
actions: %w[topics#destroy],
},
read: {
actions: %w[topics#show topics#feed topics#posts],
params: %i[topic_id],
@ -55,6 +58,14 @@ class ApiKeyScope < ActiveRecord::Base
actions: %w[posts#update],
params: %i[id],
},
delete: {
actions: %w[posts#destroy],
},
},
tags: {
list: {
actions: %w[tags#index],
},
},
categories: {
list: {

View File

@ -4699,10 +4699,14 @@ en:
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.
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.
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:
edit: Edit any post or a specific one.
delete: Delete a post.
tags:
list: List tags.
categories:
list: Get a list of categories.
show: Get a single category by id.

View File

@ -423,6 +423,7 @@ RSpec.describe Admin::ApiController do
"users",
"email",
"posts",
"tags",
"uploads",
"user_status",
"global",