Skip to content

A platform for community discussion. Free, open, simple.

FEATURE: Allow user_status scope for UserApiKey (#19296)

Martin Brennane6f9504dd607
diff --git a/app/models/user_api_key_scope.rb b/app/models/user_api_key_scope.rb
index 6b54d3ca65c..d2f0c408a36 100644
--- a/app/models/user_api_key_scope.rb
+++ b/app/models/user_api_key_scope.rb
@@ -16,7 +16,12 @@ class UserApiKeyScope < ActiveRecord::Base
RouteMatcher.new(methods: :get, actions: 'session#current'),
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
@@ -36,7 +41,6 @@ class UserApiKeyScope < ActiveRecord::Base
def matchers
@matchers ||= Array(self.class.all_scopes[name.to_sym])
end
-
end
# == Schema Information
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index f87e4ee5eef..b57fb47134d 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -1089,6 +1089,7 @@ en:
write: "Write all"
one_time_password: "Create a one-time login token"
bookmarks_calendar: "Read bookmark reminders"
+ user_status: "Read and update user status"
invalid_public_key: "Sorry, the public key is invalid."
invalid_auth_redirect: "Sorry, this auth_redirect host is not allowed."
invalid_token: "Missing, invalid or expired token."