Path: redb/redb.Core/Models/Permissions/EffectivePermissionResult.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/Permissions/EffectivePermissionResult.cs
----
namespace redb.Core.Models.Permissions
{
///
/// Result of getting user's effective permissions on object
///
public class EffectivePermissionResult
{
///
/// Object ID
///
public long ObjectId { get; set; }
///
/// User ID
///
public long UserId { get; set; }
///
/// Permission source ID (object from which permission is inherited)
///
public long PermissionSourceId { get; set; }
///
/// Permission type (user or role-based)
///
public string PermissionType { get; set; } = "";
///
/// Role ID (if permission is role-based)
///
public long? RoleId { get; set; }
///
/// User ID in permission (if permission is user-based)
///
public long? PermissionUserId { get; set; }
///
/// Read permission
///
public bool CanSelect { get; set; }
///
/// Permission to create child objects
///
public bool CanInsert { get; set; }
///
/// Edit permission
///
public bool CanUpdate { get; set; }
///
/// Delete permission
///
public bool CanDelete { get; set; }
///
/// Permission is inherited from parent object
///
public bool IsInherited => PermissionSourceId != ObjectId;
///
/// Has any permissions
///
public bool HasAnyPermission => CanSelect || CanInsert || CanUpdate || CanDelete;
///
/// Has full permissions (all actions allowed)
///
public bool HasFullPermission => CanSelect && CanInsert && CanUpdate && CanDelete;
}
}