mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-24 00:52:23 -04:00
25 lines
613 B
C#
25 lines
613 B
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using API.Constants;
|
|
using API.Entities;
|
|
using Microsoft.AspNetCore.Identity;
|
|
|
|
namespace API.Data
|
|
{
|
|
public static class Seed
|
|
{
|
|
public static async Task SeedRoles(RoleManager<AppRole> roleManager)
|
|
{
|
|
var roles = new List<AppRole>
|
|
{
|
|
new() {Name = PolicyConstants.AdminRole},
|
|
new() {Name = PolicyConstants.PlebRole}
|
|
};
|
|
|
|
foreach (var role in roles)
|
|
{
|
|
await roleManager.CreateAsync(role);
|
|
}
|
|
}
|
|
}
|
|
} |