37 lines
1.8 KiB
C#
37 lines
1.8 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace back.DataModels;
|
|
|
|
[Table("Permissions")]
|
|
public class PermissionModel
|
|
{
|
|
public PermissionModel() { }
|
|
|
|
[Key]
|
|
public string Id { get; set; }
|
|
[Required, MaxLength(100)]
|
|
public string Name { get; set; }
|
|
[MaxLength(255)]
|
|
public string Description { get; set; }
|
|
|
|
public PermissionModel(string id, string name, string description)
|
|
{
|
|
Id = id;
|
|
Name = name;
|
|
Description = description;
|
|
}
|
|
|
|
// Static permissions
|
|
public static readonly PermissionModel ViewContentPermission = new("1", "VIEW_CONTENT", "Permission to view content");
|
|
public static readonly PermissionModel LikeContentPermission = new("2", "LIKE_CONTENT", "Permission to like content");
|
|
public static readonly PermissionModel EditContentPermission = new("3", "EDIT_CONTENT", "Permission to edit content");
|
|
public static readonly PermissionModel DeleteContentPermission = new("4", "DELETE_CONTENT", "Permission to delete content");
|
|
public static readonly PermissionModel CreateContentPermission = new("5", "CREATE_CONTENT", "Permission to create new content");
|
|
public static readonly PermissionModel EditUserPermission = new("6", "EDIT_USER", "Permission to edit user");
|
|
public static readonly PermissionModel DeleteUserPermission = new("7", "DELETE_USER", "Permission to delete user");
|
|
public static readonly PermissionModel DisableUserPermission = new("8", "DISABLE_USER", "Permission to disable user");
|
|
public static readonly PermissionModel CreateUserPermission = new("9", "CREATE_USER", "Permission to create new user");
|
|
public static readonly PermissionModel EditWebConfigPermission = new("10", "EDIT_WEB_CONFIG", "Permission to edit web configuration");
|
|
}
|