diff --git a/app/models/api_key_scope.rb b/app/models/api_key_scope.rb index eeb7934f12a..9d26803ec40 100644 --- a/app/models/api_key_scope.rb +++ b/app/models/api_key_scope.rb @@ -36,6 +36,10 @@ class ApiKeyScope < ActiveRecord::Base posts: { edit: { actions: %w[posts#update], params: %i[id] } }, + categories: { + list: { actions: %w[categories#index] }, + show: { actions: %w[categories#show], params: %i[id] } + }, uploads: { create: { actions: %w[ diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index d45d731e3a2..20934c5e47c 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -4219,6 +4219,9 @@ en: wordpress: Necessary for the WordPress wp-discourse plugin to work. posts: edit: Edit any post or a specific one. + categories: + list: Get a list of categories. + show: Get a single category by id. uploads: create: Upload a new file or initiate single or multipart direct uploads to external storage. users: diff --git a/spec/requests/admin/api_controller_spec.rb b/spec/requests/admin/api_controller_spec.rb index 27f458daaf9..a8b863ceff5 100644 --- a/spec/requests/admin/api_controller_spec.rb +++ b/spec/requests/admin/api_controller_spec.rb @@ -235,7 +235,7 @@ describe Admin::ApiController do scopes = response.parsed_body['scopes'] - expect(scopes.keys).to contain_exactly('topics', 'users', 'email', 'posts', 'uploads', 'global', 'badges') + expect(scopes.keys).to contain_exactly('topics', 'users', 'email', 'posts', 'uploads', 'global', 'badges', 'categories') end end end