| | | 1 | | using System.Text.Json.Serialization; |
| | | 2 | | using ArturRios.Heimdall.Shared.Security; |
| | | 3 | | using ArturRios.Mediator.Command; |
| | | 4 | | |
| | | 5 | | namespace ArturRios.Heimdall.Command.Input; |
| | | 6 | | |
| | | 7 | | /// <summary> |
| | | 8 | | /// Lifts a restriction on processing (UC-45, GDPR Art. 18(3)). |
| | | 9 | | /// </summary> |
| | | 10 | | /// <remarks> |
| | | 11 | | /// <para> |
| | | 12 | | /// Two callers, and the difference matters. A <b>System Admin</b> lifting somebody else's |
| | | 13 | | /// restriction must inform them first — Art. 18(3) makes that a precondition, not a courtesy |
| | | 14 | | /// afterwards. A <b>subject</b> lifting their own needs no notification: they are the person |
| | | 15 | | /// who would be notified. |
| | | 16 | | /// </para> |
| | | 17 | | /// <para> |
| | | 18 | | /// <see cref="SubjectId" /> is therefore optional. Absent, the caller is lifting their own; |
| | | 19 | | /// present, they are acting on somebody else's and the role requirement applies. |
| | | 20 | | /// </para> |
| | | 21 | | /// </remarks> |
| | | 22 | | public class LiftProcessingRestrictionCommand : BaseCommand, IActorScoped |
| | | 23 | | { |
| | | 24 | | /// <summary> |
| | | 25 | | /// The identity whose restriction is being lifted, or <c>null</c> to lift the caller's own. |
| | | 26 | | /// </summary> |
| | 25 | 27 | | public Guid? SubjectId { get; set; } |
| | | 28 | | |
| | | 29 | | [JsonIgnore] |
| | 41 | 30 | | public Guid ActingPersonId { get; set; } |
| | | 31 | | |
| | | 32 | | [JsonIgnore] |
| | 25 | 33 | | public int ActingRole { get; set; } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Whether the caller's token is subject-rights-only (NFR-24) — issued to a restricted |
| | | 37 | | /// identity at sign-in. Such a token acts for its subject alone, so it never lifts anybody |
| | | 38 | | /// else's restriction, whatever role it claims and even once its own restriction is gone. |
| | | 39 | | /// Taken from the token, never from the request. |
| | | 40 | | /// </summary> |
| | | 41 | | [JsonIgnore] |
| | 16 | 42 | | public bool ActingSubjectRightsOnly { get; set; } |
| | | 43 | | } |