using SurrealDb.Net.Models;
namespace RelayServer.Models;
///
/// Surreal record for the `channel_permissions` table. Per-(channel, role) override of a
/// role's base permissions.
///
/// Allow and Deny are independent masks (NOT a tri-state). Deny wins over Allow when both
/// have the same flag set. Bits not set in either fall through to the role's base permissions.
///
public class ChannelPermissions : Record
{
/// "channels:xyz" — which channel this override applies in.
public required string ChannelId { get; set; }
/// "roles:abc" — which role this override applies to.
public required string RoleId { get; set; }
/// Permissions explicitly granted here (overrides "role doesn't have it" for this channel).
public PermissionFlags Allow { get; set; }
/// Permissions explicitly denied here. Wins over Allow.
public PermissionFlags Deny { get; set; }
}