mirror of
https://github.com/discourse/discourse.git
synced 2026-03-04 01:15:08 +08:00
### What is this change? Follow-up to #31601. This will be used for display in the admin API keys UI.
18 lines
517 B
Ruby
18 lines
517 B
Ruby
# frozen_string_literal: true
|
|
|
|
Fabricator(:api_key)
|
|
|
|
Fabricator(:global_api_key, from: :api_key)
|
|
|
|
Fabricator(:read_only_api_key, from: :api_key) do
|
|
api_key_scopes(count: 1) do |attrs, i|
|
|
Fabricate.build(:api_key_scope, resource: "global", action: "read")
|
|
end
|
|
end
|
|
|
|
Fabricator(:granular_api_key, from: :api_key) do
|
|
api_key_scopes(count: 1) do |attrs, i|
|
|
Fabricate.build(:api_key_scope, resource: "topics", action: "read")
|
|
Fabricate.build(:api_key_scope, resource: "topics", action: "write")
|
|
end
|
|
end
|