Relax and rename auth policies for sender/receiver roles
Replaced SenderOrReceiverFullyAuth and ReceiverFullyAuth policies with more general SenderOrReceiver and Receiver policies. Updated policy definitions in AuthPolicy.cs to use nameof for clarity. Adjusted AddAuthorizationBuilder configuration and [Authorize] attributes in controllers to use the new, less restrictive policies, simplifying authorization logic.
This commit is contained in:
@@ -178,9 +178,9 @@ try
|
||||
});
|
||||
|
||||
builder.Services.AddAuthorizationBuilder()
|
||||
.AddPolicy(AuthPolicy.SenderOrReceiverFullyAuth, policy =>
|
||||
.AddPolicy(AuthPolicy.SenderOrReceiver, policy =>
|
||||
policy.RequireRole(Role.Sender, Role.Receiver.FullyAuth))
|
||||
.AddPolicy(AuthPolicy.ReceiverFullyAuth, policy =>
|
||||
.AddPolicy(AuthPolicy.Receiver, policy =>
|
||||
policy.RequireRole(Role.Receiver.FullyAuth));
|
||||
|
||||
// User manager
|
||||
|
||||
Reference in New Issue
Block a user