mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Implements authorization caching and check in the web client
This commit is contained in:
1 parent
7bca5b1ba3
commit
8eb1b9f13c
108 files changed
+5931
-73
No files matched your search
@@ -25,24 +25,30 @@ public class PermissionConfiguration : IEntityTypeConfiguration<PermissionEntity
|
||||
|
||||
builder.Property(permission => permission.PermissionName)
|
||||
.IsRequired()
|
||||
.HasConversion<string>()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnOrder(1);
|
||||
|
||||
builder.Property(permission => permission.PermissionDescription)
|
||||
.HasMaxLength(255)
|
||||
.HasDefaultValue(null)
|
||||
.HasColumnOrder(2);
|
||||
|
||||
// audit
|
||||
builder.Property(permission => permission.CreatedOnUtc)
|
||||
.IsRequired()
|
||||
.HasColumnOrder(2);
|
||||
.HasColumnOrder(3);
|
||||
|
||||
builder.Property(permission => permission.CreatedBy)
|
||||
.IsRequired()
|
||||
.HasColumnOrder(3);
|
||||
.HasColumnOrder(4);
|
||||
|
||||
builder.Property(permission => permission.UpdatedOnUtc)
|
||||
.HasDefaultValue(null)
|
||||
.HasColumnOrder(4);
|
||||
.HasColumnOrder(5);
|
||||
|
||||
builder.Property(permission => permission.UpdatedBy)
|
||||
.HasDefaultValue(null)
|
||||
.HasColumnOrder(5);
|
||||
.HasColumnOrder(6);
|
||||
}
|
||||
}
|
||||
@@ -25,24 +25,30 @@ public class RoleConfiguration : IEntityTypeConfiguration<RoleEntity>
|
||||
|
||||
builder.Property(role => role.RoleName)
|
||||
.IsRequired()
|
||||
.HasConversion<string>()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnOrder(1);
|
||||
|
||||
builder.Property(permission => permission.RoleDescription)
|
||||
.HasMaxLength(255)
|
||||
.HasDefaultValue(null)
|
||||
.HasColumnOrder(2);
|
||||
|
||||
// audit
|
||||
builder.Property(role => role.CreatedOnUtc)
|
||||
.IsRequired()
|
||||
.HasColumnOrder(2);
|
||||
.HasColumnOrder(3);
|
||||
|
||||
builder.Property(role => role.CreatedBy)
|
||||
.IsRequired()
|
||||
.HasColumnOrder(3);
|
||||
.HasColumnOrder(4);
|
||||
|
||||
builder.Property(role => role.UpdatedOnUtc)
|
||||
.HasDefaultValue(null)
|
||||
.HasColumnOrder(4);
|
||||
.HasColumnOrder(5);
|
||||
|
||||
builder.Property(role => role.UpdatedBy)
|
||||
.HasDefaultValue(null)
|
||||
.HasColumnOrder(5);
|
||||
.HasColumnOrder(6);
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,8 @@ public class RolePermissionConfiguration : IEntityTypeConfiguration<RolePermissi
|
||||
|
||||
// composite primary key
|
||||
builder.HasKey(rolePermission => new { rolePermission.RoleId, rolePermission.PermissionId });
|
||||
|
||||
builder.Ignore(rolePermission => rolePermission.Id); // Id is only needed as a generic constraint for the repository, but this entity uses a composite key as Id
|
||||
|
||||
// foreign key: Role
|
||||
builder.HasOne(rolePermission => rolePermission.Role)
|
||||
|
||||
@@ -22,6 +22,8 @@ public class UserPermissionConfiguration : IEntityTypeConfiguration<UserPermissi
|
||||
// composite primary key
|
||||
builder.HasKey(userPermission => new { userPermission.UserId, userPermission.PermissionId });
|
||||
|
||||
builder.Ignore(userPermission => userPermission.Id); // Id is only needed as a generic constraint for the repository, but this entity uses a composite key as Id
|
||||
|
||||
// foreign key: User
|
||||
builder.HasOne(userPermission => userPermission.User)
|
||||
.WithMany(user => user.UserPermissions)
|
||||
|
||||
@@ -21,7 +21,9 @@ public class UserRoleConfiguration : IEntityTypeConfiguration<UserRoleEntity>
|
||||
|
||||
// composite primary key
|
||||
builder.HasKey(userRole => new { userRole.UserId, userRole.RoleId });
|
||||
|
||||
|
||||
builder.Ignore(userRole => userRole.Id); // Id is only needed as a generic constraint for the repository, but this entity uses a composite key as Id
|
||||
|
||||
// foreign key: User
|
||||
builder.HasOne(userRole => userRole.User)
|
||||
.WithMany(user => user.UserRoles)
|
||||
|
||||
Reference in new issue
Block a user