FEATURE: adds uploads scope for API keys (#14941)
* FEATURE: adds uploads scope for API keys * Add basic test, change "image" to "file"
This commit is contained in:
parent
c891c44775
commit
fd66df5997
|
@ -35,6 +35,9 @@ class ApiKeyScope < ActiveRecord::Base
|
||||||
posts: {
|
posts: {
|
||||||
edit: { actions: %w[posts#update], params: %i[id] }
|
edit: { actions: %w[posts#update], params: %i[id] }
|
||||||
},
|
},
|
||||||
|
uploads: {
|
||||||
|
create: { actions: %w[uploads#create] }
|
||||||
|
},
|
||||||
users: {
|
users: {
|
||||||
bookmarks: { actions: %w[users#bookmarks], params: %i[username] },
|
bookmarks: { actions: %w[users#bookmarks], params: %i[username] },
|
||||||
sync_sso: { actions: %w[admin/users#sync_sso], params: %i[sso sig] },
|
sync_sso: { actions: %w[admin/users#sync_sso], params: %i[sso sig] },
|
||||||
|
|
|
@ -4193,6 +4193,8 @@ en:
|
||||||
wordpress: Necessary for the WordPress wp-discourse plugin to work.
|
wordpress: Necessary for the WordPress wp-discourse plugin to work.
|
||||||
posts:
|
posts:
|
||||||
edit: Edit any post or a specific one.
|
edit: Edit any post or a specific one.
|
||||||
|
uploads:
|
||||||
|
create: Upload a new file.
|
||||||
users:
|
users:
|
||||||
bookmarks: List user bookmarks. It returns bookmark reminders when using the ICS format.
|
bookmarks: List user bookmarks. It returns bookmark reminders when using the ICS format.
|
||||||
sync_sso: Synchronize a user using DiscourseConnect.
|
sync_sso: Synchronize a user using DiscourseConnect.
|
||||||
|
|
|
@ -237,7 +237,7 @@ describe Admin::ApiController do
|
||||||
|
|
||||||
scopes = response.parsed_body['scopes']
|
scopes = response.parsed_body['scopes']
|
||||||
|
|
||||||
expect(scopes.keys).to contain_exactly('topics', 'users', 'email', 'posts', 'global')
|
expect(scopes.keys).to contain_exactly('topics', 'users', 'email', 'posts', 'uploads', 'global')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue