15 lines
521 B
C#
15 lines
521 B
C#
using Microsoft.AspNetCore.Authentication;
|
|
|
|
namespace PARR.API.RoleProvider
|
|
{
|
|
public static class SimpleRoleAuthorizationServiceCollectionExtensions
|
|
{
|
|
public static void AddSimpleRoleAuthorization<TRoleProvider>(this IServiceCollection services)
|
|
where TRoleProvider : class, ISimpleRoleProvider
|
|
{
|
|
services.AddSingleton<ISimpleRoleProvider, TRoleProvider>();
|
|
services.AddSingleton<IClaimsTransformation, SimpleRoleAuthorizationTransform>();
|
|
}
|
|
}
|
|
}
|