2021-11-29 12:39:28 +05:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2021-04-02 17:28:07 +05:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudDb.Model
|
|
|
|
|
{
|
|
|
|
|
[Table("t_user_role"), Comment("Роли пользователей в системе")]
|
2021-04-07 18:01:56 +05:00
|
|
|
|
public class UserRole : IId
|
2021-04-02 17:28:07 +05:00
|
|
|
|
{
|
|
|
|
|
[Key]
|
|
|
|
|
[Column("id")]
|
|
|
|
|
public int Id { get; set; }
|
|
|
|
|
|
|
|
|
|
[Column("caption"), Comment("Название")]
|
|
|
|
|
[StringLength(255)]
|
|
|
|
|
public string Caption { get; set; }
|
|
|
|
|
|
2021-11-29 17:34:53 +05:00
|
|
|
|
[Column("id_type"), Comment("0-роль из стандартной матрицы, \n1-специальная роль для какого-либо пользователя")]
|
|
|
|
|
public int IdType { get; set; }
|
2021-11-24 11:30:29 +05:00
|
|
|
|
|
|
|
|
|
[Column("id_parent"), Comment("От какой роли унаследована данная роль")]
|
2021-11-29 17:34:53 +05:00
|
|
|
|
public int? IdParent { get; set; }
|
2021-11-24 11:30:29 +05:00
|
|
|
|
|
2021-11-29 12:39:28 +05:00
|
|
|
|
|
2021-11-24 11:30:29 +05:00
|
|
|
|
[InverseProperty(nameof(RelationUserUserRole.UserRole))]
|
|
|
|
|
public virtual ICollection<RelationUserUserRole> RelationUsersUserRoles { get; set; }
|
2021-11-29 12:39:28 +05:00
|
|
|
|
|
2021-12-15 16:21:52 +05:00
|
|
|
|
[InverseProperty(nameof(RelationUserRolePermission.UserRole))]
|
|
|
|
|
public virtual ICollection<RelationUserRolePermission> RelationUserRolePermissions { get; set; }
|
2021-04-02 17:28:07 +05:00
|
|
|
|
}
|
|
|
|
|
}
|