Class PermissionGrant
- Namespace
- Cloudflare.NET.Roles.Models
- Assembly
- Cloudflare.NET.dll
Read/write permission pair for a feature.
Represents the access level granted for a specific feature area. Both read and write can be independently enabled or disabled.
public record PermissionGrant : IEquatable<PermissionGrant>
- Inheritance
-
PermissionGrant
- Implements
- Inherited Members
Examples
// Check if role can modify DNS
if (role.Permissions.DnsRecords is { Write: true })
{
Console.WriteLine("Role can modify DNS records");
}
Constructors
PermissionGrant(bool, bool)
Read/write permission pair for a feature.
Represents the access level granted for a specific feature area. Both read and write can be independently enabled or disabled.
public PermissionGrant(bool Read = false, bool Write = false)
Parameters
Examples
// Check if role can modify DNS
if (role.Permissions.DnsRecords is { Write: true })
{
Console.WriteLine("Role can modify DNS records");
}
Properties
Read
Whether read access is granted.
[JsonPropertyName("read")]
public bool Read { get; init; }
Property Value
Write
Whether write access is granted.
[JsonPropertyName("write")]
public bool Write { get; init; }