FEATURE: Add API Scope for latest posts (#21913)
Adds api scopes for - `/posts.json` - `/posts.rss` - `/private-posts.json` - `/private-posts.rss`
This commit is contained in:
parent
2032d3c2fb
commit
704a792f18
|
@ -61,6 +61,9 @@ class ApiKeyScope < ActiveRecord::Base
|
|||
delete: {
|
||||
actions: %w[posts#destroy],
|
||||
},
|
||||
list: {
|
||||
actions: %w[posts#latest],
|
||||
},
|
||||
},
|
||||
tags: {
|
||||
list: {
|
||||
|
|
|
@ -4778,6 +4778,7 @@ en:
|
|||
posts:
|
||||
edit: Edit any post or a specific one.
|
||||
delete: Delete a post.
|
||||
list: List latest posts and private posts. RSS is also supported.
|
||||
tags:
|
||||
list: List tags.
|
||||
categories:
|
||||
|
|
|
@ -436,6 +436,8 @@ RSpec.describe Admin::ApiController do
|
|||
)
|
||||
|
||||
expect(scopes["topics"].any? { |h| h["urls"].include?("/latest.rss (GET)") }).to be_truthy
|
||||
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
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue