Path: redb/redb.Core/Models/Contracts/IRedbSecurityContext.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Core/Models/Contracts/IRedbSecurityContext.cs
----
using System;
namespace redb.Core.Models.Contracts
{
///
/// REDB security context
/// Manages current user and operation mode
///
public interface IRedbSecurityContext
{
///
/// Current user (can be null for system context)
///
IRedbUser? CurrentUser { get; }
///
/// System context (no permission checking)
///
bool IsSystemContext { get; }
///
/// User is authenticated (not system context and user is set)
///
bool IsAuthenticated { get; }
///
/// Get effective user ID with fallback logic
/// Returns current user ID or sys ID (0)
///
long GetEffectiveUserId();
///
/// Get effective user
/// Returns current user or system user
///
IRedbUser GetEffectiveUser();
///
/// Set current user
///
void SetCurrentUser(IRedbUser? user);
///
/// Create temporary system context
///
IDisposable CreateSystemContext();
}
}