27 lines
808 B
C#
27 lines
808 B
C#
using System;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
namespace gehGassi.Web.Auth.Requirements
|
|
{
|
|
/// <summary>
|
|
/// Requirement für eine Permission in Kombination mit Policies
|
|
/// </summary>
|
|
public class PermissionRequirement : IAuthorizationRequirement
|
|
{
|
|
/// <summary>
|
|
/// Name der Permission
|
|
/// </summary>
|
|
public string PermissionName { get; }
|
|
|
|
/// <summary>
|
|
/// Erstellt eine Instanz
|
|
/// </summary>
|
|
/// <param name="permissionName">Name der Permission</param>
|
|
/// <exception cref="ArgumentNullException"></exception>
|
|
public PermissionRequirement(string permissionName)
|
|
{
|
|
PermissionName = permissionName ?? throw new ArgumentNullException(nameof(permissionName));
|
|
}
|
|
}
|
|
}
|