mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:57:25 +08:00
FEATURE: Add recover api scopes (#25978)
This commit adds two new api scopes. One for recovering topics, and the other for recovering posts.
This commit is contained in:
@ -478,6 +478,7 @@ RSpec.describe Admin::ApiController do
|
||||
"/t/:slug/:topic_id/last (GET)",
|
||||
"/t/:topic_id/posts (GET)",
|
||||
"/latest.rss (GET)",
|
||||
"/t/:topic_id/recover (PUT)",
|
||||
]
|
||||
|
||||
topic_routes.each do |route|
|
||||
@ -486,6 +487,9 @@ RSpec.describe Admin::ApiController do
|
||||
|
||||
expect(scopes["posts"].any? { |h| h["urls"].include?("/posts (GET)") }).to be_truthy
|
||||
expect(scopes["posts"].any? { |h| h["urls"].include?("/private-posts (GET)") }).to be_truthy
|
||||
expect(
|
||||
scopes["posts"].any? { |h| h["urls"].include?("/posts/:post_id/recover (PUT)") },
|
||||
).to be_truthy
|
||||
|
||||
expect(scopes["users"].find { _1["key"] == "update" }["urls"]).to contain_exactly(
|
||||
"/users/:username (PUT)",
|
||||
|
Reference in New Issue
Block a user