Class TokenPolicy
- Namespace
- Cloudflare.NET.ApiTokens.Models
- Assembly
- Cloudflare.NET.dll
A token policy defining allowed or denied permissions and resources.
Each policy specifies an effect (allow or deny), the permission groups that define what actions are permitted, and the resources the policy applies to.
public record TokenPolicy : IEquatable<TokenPolicy>
- Inheritance
-
TokenPolicy
- Implements
- Inherited Members
Constructors
TokenPolicy(string?, string, IReadOnlyList<TokenPermissionGroupReference>, IReadOnlyDictionary<string, string>)
A token policy defining allowed or denied permissions and resources.
Each policy specifies an effect (allow or deny), the permission groups that define what actions are permitted, and the resources the policy applies to.
public TokenPolicy(string? Id, string Effect, IReadOnlyList<TokenPermissionGroupReference> PermissionGroups, IReadOnlyDictionary<string, string> Resources)
Parameters
IdstringPolicy identifier. May be null for new policies.
EffectstringPolicy effect: "allow" or "deny".
PermissionGroupsIReadOnlyList<TokenPermissionGroupReference>Permission groups granted by this policy.
ResourcesIReadOnlyDictionary<string, string>Resources this policy applies to. Keys are resource types, values are resource identifiers or wildcards.
Properties
Effect
Policy effect: "allow" or "deny".
[JsonPropertyName("effect")]
public string Effect { get; init; }
Property Value
Id
Policy identifier. May be null for new policies.
[JsonPropertyName("id")]
public string? Id { get; init; }
Property Value
PermissionGroups
Permission groups granted by this policy.
[JsonPropertyName("permission_groups")]
public IReadOnlyList<TokenPermissionGroupReference> PermissionGroups { get; init; }
Property Value
Resources
Resources this policy applies to. Keys are resource types, values are resource identifiers or wildcards.
[JsonPropertyName("resources")]
public IReadOnlyDictionary<string, string> Resources { get; init; }