< Summary

Information
Class: Elsa.Identity.Notifications.RoleChanged
Assembly: Elsa.Identity
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Identity/Notifications/RoleSecurityNotifications.cs
Line coverage
83%
Covered lines: 5
Uncovered lines: 1
Coverable lines: 6
Total lines: 37
Line coverage: 83.3%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
get_Context()100%210%
get_Operation()100%11100%
get_RoleId()100%11100%
get_RoleName()100%11100%
get_Permissions()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Identity/Notifications/RoleSecurityNotifications.cs

#LineLine coverage
 1using Elsa.Mediator.Contracts;
 2
 3namespace Elsa.Identity.Notifications;
 4
 5/// <summary>
 6/// Safe context shared by role and assignment security notifications. It deliberately carries no secret,
 7/// credential, or token: these are published for audit subscribers, and this module owns no audit store.
 8/// </summary>
 9/// <param name="ActorId">Who performed the change, where the caller is identifiable.</param>
 10/// <param name="TenantId">The tenant the change applies to.</param>
 11public sealed record RoleSecurityEventContext(
 12    string? ActorId,
 13    string? TenantId,
 14    DateTimeOffset OccurredAt,
 15    string Summary);
 16
 17/// <summary>Published when a role is created, updated, or deleted.</summary>
 18/// <param name="Operation">One of <c>created</c>, <c>updated</c>, or <c>deleted</c>.</param>
 19/// <param name="Permissions">
 20/// The resulting grants, so a reviewer can reconstruct what a role conferred at a point in time without
 21/// replaying every prior event.
 22/// </param>
 423public sealed record RoleChanged(
 024    RoleSecurityEventContext Context,
 425    string Operation,
 426    string RoleId,
 427    string RoleName,
 828    IReadOnlyCollection<string> Permissions) : INotification;
 29
 30/// <summary>Published when roles are assigned to or removed from a user.</summary>
 31/// <param name="Assigned">Role identifiers added by this change.</param>
 32/// <param name="Removed">Role identifiers withdrawn by this change.</param>
 33public sealed record UserRoleAssignmentChanged(
 34    RoleSecurityEventContext Context,
 35    string UserId,
 36    IReadOnlyCollection<string> Assigned,
 37    IReadOnlyCollection<string> Removed) : INotification;