FEATURE: Add api scope for search endpoint (#19955)
Adds two new api scopes for the /search endpoints: - `/search.json?q=term` - `/search/query.json?term=term` see: https://meta.discourse.org/t/search-api-key-permissions/227244
This commit is contained in:
parent
ad70a72de9
commit
09f5235538
|
@ -146,6 +146,16 @@ class ApiKeyScope < ActiveRecord::Base
|
||||||
actions: %w[user_badges#destroy],
|
actions: %w[user_badges#destroy],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
search: {
|
||||||
|
show: {
|
||||||
|
actions: %w[search#show],
|
||||||
|
params: %i[q page],
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
actions: %w[search#query],
|
||||||
|
params: %i[term],
|
||||||
|
},
|
||||||
|
},
|
||||||
wordpress: {
|
wordpress: {
|
||||||
publishing: {
|
publishing: {
|
||||||
actions: %w[site#site posts#create topics#update topics#status topics#show],
|
actions: %w[site#site posts#create topics#update topics#status topics#show],
|
||||||
|
|
|
@ -4703,6 +4703,9 @@ en:
|
||||||
list_user_badges: List user badges.
|
list_user_badges: List user badges.
|
||||||
assign_badge_to_user: Assign a badge to a user.
|
assign_badge_to_user: Assign a badge to a user.
|
||||||
revoke_badge_from_user: Revoke a badge from a user.
|
revoke_badge_from_user: Revoke a badge from a user.
|
||||||
|
search:
|
||||||
|
show: Search using the `/search.json?q=term` endpoint.
|
||||||
|
query: Search using the /search/query?term=term` endpoint.
|
||||||
wordpress:
|
wordpress:
|
||||||
publishing: Necessary for the WP Discourse plugin publishing features (required).
|
publishing: Necessary for the WP Discourse plugin publishing features (required).
|
||||||
commenting: Necessary for the WP Discourse plugin commenting features.
|
commenting: Necessary for the WP Discourse plugin commenting features.
|
||||||
|
|
|
@ -428,6 +428,7 @@ RSpec.describe Admin::ApiController do
|
||||||
"global",
|
"global",
|
||||||
"badges",
|
"badges",
|
||||||
"categories",
|
"categories",
|
||||||
|
"search",
|
||||||
"wordpress",
|
"wordpress",
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue