mirror of
https://github.com/discourse/discourse.git
synced 2025-06-24 00:41:33 +08:00

### What is this change? Follow-up to #31601. This will be used for display in the admin API keys UI.
19 lines
517 B
Ruby
19 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
|