mirror of
https://github.com/discourse/discourse.git
synced 2025-04-26 20:44:28 +08:00
FEATURE: Allow user_status scope for UserApiKey (#19296)
Follow-up to 6357a3ce337bdf59c7a6a0f362897a46ffbd6304 where we allowed a general API key scope for user status GET/PUT/DELETE, this commit allows the same for the UserApiKey system.
This commit is contained in:
parent
22a55ef0ce
commit
e6f9504dd6
@ -16,7 +16,12 @@ class UserApiKeyScope < ActiveRecord::Base
|
|||||||
RouteMatcher.new(methods: :get, actions: 'session#current'),
|
RouteMatcher.new(methods: :get, actions: 'session#current'),
|
||||||
RouteMatcher.new(methods: :get, actions: 'users#topic_tracking_state')
|
RouteMatcher.new(methods: :get, actions: 'users#topic_tracking_state')
|
||||||
],
|
],
|
||||||
bookmarks_calendar: [ RouteMatcher.new(methods: :get, actions: 'users#bookmarks', formats: :ics, params: %i[username]) ]
|
bookmarks_calendar: [ RouteMatcher.new(methods: :get, actions: 'users#bookmarks', formats: :ics, params: %i[username]) ],
|
||||||
|
user_status: [
|
||||||
|
RouteMatcher.new(methods: :get, actions: 'user_status#get'),
|
||||||
|
RouteMatcher.new(methods: :put, actions: 'user_status#set'),
|
||||||
|
RouteMatcher.new(methods: :delete, actions: 'user_status#clear')
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
def self.all_scopes
|
def self.all_scopes
|
||||||
@ -36,7 +41,6 @@ class UserApiKeyScope < ActiveRecord::Base
|
|||||||
def matchers
|
def matchers
|
||||||
@matchers ||= Array(self.class.all_scopes[name.to_sym])
|
@matchers ||= Array(self.class.all_scopes[name.to_sym])
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
|
@ -1089,6 +1089,7 @@ en:
|
|||||||
write: "Write all"
|
write: "Write all"
|
||||||
one_time_password: "Create a one-time login token"
|
one_time_password: "Create a one-time login token"
|
||||||
bookmarks_calendar: "Read bookmark reminders"
|
bookmarks_calendar: "Read bookmark reminders"
|
||||||
|
user_status: "Read and update user status"
|
||||||
invalid_public_key: "Sorry, the public key is invalid."
|
invalid_public_key: "Sorry, the public key is invalid."
|
||||||
invalid_auth_redirect: "Sorry, this auth_redirect host is not allowed."
|
invalid_auth_redirect: "Sorry, this auth_redirect host is not allowed."
|
||||||
invalid_token: "Missing, invalid or expired token."
|
invalid_token: "Missing, invalid or expired token."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user