Path: redb/redb.Core/Configuration/IUserConfigurationService.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/Configuration/IUserConfigurationService.cs
----
using System.Threading.Tasks;
using redb.Core.Models.Configuration;
using redb.Core.Models.Entities;
namespace redb.Core.Configuration
{
///
/// Service for managing user configurations
/// Provides merging of configurations from the chain:
/// RedbServiceConfiguration -> Default User Config -> Role Config -> User Config
///
public interface IUserConfigurationService
{
///
/// Get effective user configuration
/// (taking into account the entire inheritance chain and overrides)
///
/// User ID
/// Effective configuration with resolved values
Task GetEffectiveConfigurationAsync(long userId);
///
/// Get default configuration for regular users
/// (not for sys, but for new users)
///
/// RedbObject with default configuration or null if not created
Task?> GetDefaultConfigurationAsync();
///
/// Set configuration for user
///
/// User ID
/// Configuration object ID (RedbObject<UserConfigurationProps>) or null to reset
Task SetUserConfigurationAsync(long userId, long? configId);
///
/// Set configuration for role
///
/// Role ID
/// Configuration object ID (RedbObject<UserConfigurationProps>) or null to reset
Task SetRoleConfigurationAsync(long roleId, long? configId);
///
/// Create new configuration
///
/// Configuration name (e.g., "VIP Config")
/// Configuration properties
/// Configuration description (optional)
/// Created configuration RedbObject
Task> CreateConfigurationAsync(
string name,
UserConfigurationProps props,
string? description = null);
///
/// Invalidate user configuration cache
/// Called after changing user configuration or their roles
///
/// User ID
void InvalidateCache(long userId);
///
/// Clear entire configuration cache
/// Called after global changes
///
void ClearCache();
}
}