Refactor to use named authorization policies in controllers

Replaced direct role-based [Authorize] attributes with named
authorization policies (e.g., AuthPolicy.Receiver,
AuthPolicy.SenderOrReceiver) in AnnotationController,
DocumentController, and ReadOnlyController. Added and registered
new policies in Program.cs and updated AuthPolicy constants.
This centralizes and simplifies authorization management.
This commit is contained in:
2026-02-03 16:20:26 +01:00
parent c6c8747d23
commit 0d2425c9cf
5 changed files with 15 additions and 7 deletions

View File

@@ -3,7 +3,11 @@ namespace EnvelopeGenerator.Domain.Constants
public static class AuthPolicy
{
public const string SenderOrReceiver = nameof(SenderOrReceiver) + nameof(AuthPolicy);
public const string Sender = nameof(Sender) + nameof(AuthPolicy);
public const string Receiver = nameof(Receiver) + nameof(AuthPolicy);
public const string ReceiverTFA = nameof(ReceiverTFA) + nameof(AuthPolicy);
}
}
}