Granular permission back end done
This commit is contained in:
@@ -1,9 +1,32 @@
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using FJPSite.Data.Authorisation;
|
||||
using FJPSite.Data.Identity;
|
||||
using FJPSite.Factories;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace FJPSite.Data
|
||||
namespace FJPSite.Data;
|
||||
|
||||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : IdentityDbContext<UserEntity, RoleEntity, string>(options)
|
||||
{
|
||||
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : IdentityDbContext(options)
|
||||
public DbSet<Feature> Features { get; set; }
|
||||
public DbSet<FeatureAction> FeatureActions { get; set; }
|
||||
public DbSet<Module> Modules { get; set; }
|
||||
public DbSet<ModuleFeature> ModuleFeatures { get; set; }
|
||||
public DbSet<PermissionAction> Actions { get; set; }
|
||||
public DbSet<RolePermission> RolePermissions { get; set; }
|
||||
public DbSet<UserPermission> UserPermissions { get; set; }
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
optionsBuilder.UseSeeding((context, _) =>
|
||||
{
|
||||
DbSeederFactory.SeedDatabase(this);
|
||||
context.SaveChanges();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user