44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using Microsoft.AspNetCore.Identity;
|
|
|
|
namespace gehGassi.Domain.Roles
|
|
{
|
|
/// <summary>
|
|
/// Repräsentiert eine Rolle im System. Wird um vordefinierte Permission-Sets erweitert
|
|
/// </summary>
|
|
public class ApplicationRole : IdentityRole
|
|
{
|
|
/// <summary>
|
|
/// Vordefinierte Permissions als packed string.
|
|
/// </summary>
|
|
[MaxLength(500)]
|
|
public string Permissions { get; set; }
|
|
|
|
/// <summary>
|
|
/// Erstellt eine Instanz
|
|
/// </summary>
|
|
public ApplicationRole() : base()
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Erstellt eine Instanz
|
|
/// </summary>
|
|
/// <param name="role">Rolle</param>
|
|
public ApplicationRole(string role) : base(role)
|
|
{
|
|
Permissions = string.Empty;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Erstellt eine Instanz
|
|
/// </summary>
|
|
/// <param name="role">Rolle</param>
|
|
/// <param name="permissions">Permissions als packed string</param>
|
|
public ApplicationRole(string role, string permissions) : base(role)
|
|
{
|
|
Permissions = permissions;
|
|
}
|
|
}
|
|
}
|