mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 17:27:16 +08:00
FEATURE: An API key scope for editing posts. (#13441)
This commit is contained in:
@ -33,6 +33,9 @@ class ApiKeyScope < ActiveRecord::Base
|
||||
},
|
||||
wordpress: { actions: %w[topics#wordpress], params: %i[topic_id] }
|
||||
},
|
||||
posts: {
|
||||
edit: { actions: %w[posts#update], params: %i[id] }
|
||||
},
|
||||
users: {
|
||||
bookmarks: { actions: %w[users#bookmarks], params: %i[username] },
|
||||
sync_sso: { actions: %w[admin/users#sync_sso], params: %i[sso sig] },
|
||||
@ -84,7 +87,9 @@ class ApiKeyScope < ActiveRecord::Base
|
||||
excluded_paths = %w[/new-topic /new-message /exception]
|
||||
|
||||
memo.tap do |m|
|
||||
m << path if actions.include?(action) && api_supported_path && !excluded_paths.include?(path)
|
||||
if actions.include?(action) && api_supported_path && !excluded_paths.include?(path)
|
||||
m << "#{path} (#{route.verb})"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user