features/role-updates #18
@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newsbot.Collector.Api.Domain;
|
||||
using Newsbot.Collector.Api.Domain.Consts;
|
||||
using Newsbot.Collector.Database;
|
||||
using Newsbot.Collector.Database.Repositories;
|
||||
using Newsbot.Collector.Domain.Interfaces;
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System.Text;
|
||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using Newsbot.Collector.Api.Domain;
|
||||
using Newsbot.Collector.Api.Domain.Consts;
|
||||
using Newsbot.Collector.Domain.Models.Config;
|
||||
|
||||
namespace Newsbot.Collector.Api.Startup;
|
||||
@ -44,7 +44,9 @@ public static class IdentityStartup
|
||||
services.AddAuthorization(options =>
|
||||
{
|
||||
options.AddPolicy(Authorization.AdministratorPolicy,
|
||||
b => b.RequireClaim(Authorization.AdministratorClaim, "true"));
|
||||
b => b.RequireRole(Authorization.AdministratorsRole, "true"));
|
||||
options.AddPolicy(Authorization.UserPolicy,
|
||||
b => b.RequireRole(Authorization.UsersRole, "true"));
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user