| | | 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 | | /// Intent to change a scope permission's name, description, and JWT-claim flag (UC-33). The |
| | | 9 | | /// permission is addressed by <see cref="Id" /> within <see cref="ScopeId" />, both assigned |
| | | 10 | | /// from the route. PUT semantics: <see cref="Name" />, <see cref="Description" />, and |
| | | 11 | | /// <see cref="IncludeAsJwtClaim" /> are replaced, so a caller changing only one resubmits the |
| | | 12 | | /// current values of the others. The scope is a route qualifier, never a field to write — a |
| | | 13 | | /// permission's scope is fixed at creation time. <see cref="ActingPersonId" />/<see cref="ActingRole" /> |
| | | 14 | | /// are set by the controller from the authenticated caller and are never bound from the body. |
| | | 15 | | /// All four are <c>[JsonIgnore]</c>, so they are not deserialized from the body and do not |
| | | 16 | | /// appear in the request schema. |
| | | 17 | | /// </summary> |
| | | 18 | | public class UpdateScopePermissionCommand : BaseCommand, IActorScoped |
| | | 19 | | { |
| | | 20 | | /// <summary>Public identifier of the scope the permission belongs to (assigned from the route).</summary> |
| | | 21 | | [JsonIgnore] |
| | 43 | 22 | | public Guid ScopeId { get; set; } |
| | | 23 | | |
| | | 24 | | /// <summary>Public identifier of the permission to update (assigned from the route).</summary> |
| | | 25 | | [JsonIgnore] |
| | 43 | 26 | | public Guid Id { get; set; } |
| | | 27 | | |
| | | 28 | | /// <summary>New permission display name. Required, max 200 characters.</summary> |
| | 106 | 29 | | public string Name { get; set; } = string.Empty; |
| | | 30 | | |
| | | 31 | | /// <summary>New permission description. Max 500 characters.</summary> |
| | 69 | 32 | | public string? Description { get; set; } |
| | | 33 | | |
| | | 34 | | /// <summary> |
| | | 35 | | /// New value of the flag controlling whether the permission's <see cref="Name" /> is added as |
| | | 36 | | /// a claim on the JWT issued to identities acting within the owning scope. |
| | | 37 | | /// </summary> |
| | 53 | 38 | | public bool IncludeAsJwtClaim { get; set; } |
| | | 39 | | |
| | | 40 | | [JsonIgnore] |
| | 30 | 41 | | public Guid ActingPersonId { get; set; } |
| | | 42 | | |
| | | 43 | | [JsonIgnore] |
| | 30 | 44 | | public int ActingRole { get; set; } |
| | | 45 | | } |