Refactored all Policy strings into their own constant file.
This commit is contained in:
parent
a40bc9e9f7
commit
793c13e1e6
4 changed files with 15 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.Text;
|
||||
using API.Constants;
|
||||
using API.Data;
|
||||
using API.Entities;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
|
@ -37,7 +38,7 @@ namespace API.Extensions
|
|||
});
|
||||
services.AddAuthorization(opt =>
|
||||
{
|
||||
opt.AddPolicy("RequireAdminRole", policy => policy.RequireRole("Admin"));
|
||||
opt.AddPolicy("RequireAdminRole", policy => policy.RequireRole(PolicyConstants.AdminRole));
|
||||
});
|
||||
|
||||
return services;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue