21 lines
592 B
C#
21 lines
592 B
C#
using Microsoft.AspNetCore.Authorization;
|
|
|
|
namespace ROLAC.API.Authorization;
|
|
|
|
/// <summary>
|
|
/// Authorization requirement carrying the module + action a request needs.
|
|
/// Materialized on demand by <see cref="PermissionPolicyProvider"/> from a policy
|
|
/// name of the form <c>PERM:<module>:<action></c>.
|
|
/// </summary>
|
|
public class PermissionRequirement : IAuthorizationRequirement
|
|
{
|
|
public string Module { get; }
|
|
public string Action { get; }
|
|
|
|
public PermissionRequirement(string module, string action)
|
|
{
|
|
Module = module;
|
|
Action = action;
|
|
}
|
|
}
|