mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 06:42:41 +08:00
Use lambda to dynamically evaluate allowed user api key client scopes (#30544)
This commit is contained in:
parent
13b9493bf0
commit
4d5be463f6
|
@ -5,7 +5,7 @@ class UserApiKeyClientScope < ActiveRecord::Base
|
|||
|
||||
validates :name,
|
||||
inclusion: {
|
||||
in: UserApiKeyScope.all_scopes.keys.map(&:to_s),
|
||||
in: -> { UserApiKeyScope.all_scopes.keys.map(&:to_s) },
|
||||
message: "%{value} is not a valid scope",
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user