123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- using Microsoft.EntityFrameworkCore;
- using Microsoft.EntityFrameworkCore.Metadata.Builders;
- using MTWorkHR.Core.Entities;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace MTWorkHR.Infrastructure.Configurations
- {
- public class PermissionConfiguration : IEntityTypeConfiguration<Permission>
- {
- public void Configure(EntityTypeBuilder<Permission> builder)
- {
- builder.HasData
- (
- #region Project
- new Permission()
- {
- Id = 1,
- Name = "Project",
- Desc = "Project",
- Show = true,
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 2,
- Name = "Project.Create",
- Desc = "Project.Create",
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 3,
- Name = "Project.Update",
- Desc = "Project.Update",
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 4,
- Name = "Project.Delete",
- Desc = "Project.Delete",
- CategoryName = "User"
- },
- #endregion
- #region Meeting
- new Permission()
- {
- Id = 5,
- Name = "Meeting",
- Desc = "Meeting",
- Show = true,
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 6,
- Name = "Meeting.Create",
- Desc = "Meeting.Create",
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 7,
- Name = "Meeting.Update",
- Desc = "Meeting.Update",
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 8,
- Name = "Meeting.Delete",
- Desc = "Meeting.Delete",
- CategoryName = "User"
- },
- #endregion
- #region Team
- new Permission()
- {
- Id = 9,
- Name = "Team",
- Desc = "Team",
- Show = true,
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 10,
- Name = "Team.Create",
- Desc = "Team.Create",
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 11,
- Name = "Team.Update",
- Desc = "Team.Update",
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 12,
- Name = "Team.Delete",
- Desc = "Team.Delete",
- CategoryName = "User"
- },
- #endregion
- #region UserTask
- new Permission()
- {
- Id = 13,
- Name = "UserTask",
- Desc = "UserTask",
- Show = true,
- CategoryName = "Sales"
- },
- new Permission()
- {
- Id = 14,
- Name = "UserTask.Create",
- Desc = "UserTask.Create",
- CategoryName = "Sales"
- },
- new Permission()
- {
- Id = 15,
- Name = "UserTask.Update",
- Desc = "UserTask.Update",
- CategoryName = "Sales"
- },
- new Permission()
- {
- Id = 16,
- Name = "UserTask.Delete",
- Desc = "UserTask.Delete",
- CategoryName = "User"
- },
- #endregion
- #region Company
- new Permission()
- {
- Id = 17,
- Name = "Company",
- Desc = "Company",
- Show = true,
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 18,
- Name = "Company.Create",
- Desc = "Company.Create",
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 19,
- Name = "Company.Update",
- Desc = "Company.Update",
- CategoryName = "User"
- },
- new Permission()
- {
- Id = 20,
- Name = "Company.Delete",
- Desc = "Company.Delete",
- CategoryName = "User"
- },
- #endregion
- #region User
- new Permission()
- {
- Id = 21,
- Name = "User",
- Desc = "User",
- Show = true,
- CategoryName = "Adminstration"
- },
- new Permission()
- {
- Id = 22,
- Name = "User.Create",
- Desc = "User.Create",
- CategoryName = "Adminstration"
- },
- new Permission()
- {
- Id = 23,
- Name = "User.Update",
- Desc = "User.Update",
- CategoryName = "Adminstration"
- },
- new Permission()
- {
- Id = 24,
- Name = "User.Delete",
- Desc = "User.Delete",
- CategoryName = "Adminstration"
- },
- #endregion
- #region Role
- new Permission()
- {
- Id = 25,
- Name = "Role",
- Desc = "Role",
- Show = true,
- CategoryName = "Adminstration"
- },
- new Permission()
- {
- Id = 26,
- Name = "Role.Create",
- Desc = "Role.Create",
- CategoryName = "Adminstration"
- },
- new Permission()
- {
- Id = 27,
- Name = "Role.Update",
- Desc = "Role.Update",
- CategoryName = "Adminstration"
- },
- new Permission()
- {
- Id = 28,
- Name = "Role.Delete",
- Desc = "Role.Delete",
- CategoryName = "Adminstration"
- }
- #endregion
- );
- }
- }
-
- }
|