Refactor: unify role constants under new Role class
Replaced all usages of ReceiverRole with the new Role class in EnvelopeGenerator.Domain.Constants. Removed ReceiverRole.cs and added Role.cs with PreAuth and FullyAuth constants. Updated all [Authorize] attributes and role checks in controllers and authentication logic to use Role.FullyAuth and Role.PreAuth. This centralizes role management for improved maintainability and clarity.
This commit is contained in:
@@ -15,7 +15,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace EnvelopeGenerator.Web.Controllers;
|
||||
|
||||
[Authorize(Roles = ReceiverRole.FullyAuth)]
|
||||
[Authorize(Roles = Role.FullyAuth)]
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class AnnotationController : ControllerBase
|
||||
@@ -42,7 +42,7 @@ public class AnnotationController : ControllerBase
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[Authorize(Roles = ReceiverRole.FullyAuth)]
|
||||
[Authorize(Roles = Role.FullyAuth)]
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> CreateOrUpdate([FromBody] PsPdfKitAnnotation? psPdfKitAnnotation = null, CancellationToken cancel = default)
|
||||
{
|
||||
@@ -80,7 +80,7 @@ public class AnnotationController : ControllerBase
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[Authorize(Roles = ReceiverRole.FullyAuth)]
|
||||
[Authorize(Roles = Role.FullyAuth)]
|
||||
[HttpPost("reject")]
|
||||
[Obsolete("Use DigitalData.Core.Exceptions and .Middleware")]
|
||||
public async Task<IActionResult> Reject([FromBody] string? reason = null)
|
||||
|
||||
Reference in New Issue
Block a user