Documentation modifications
This commit is contained in:
@@ -5,6 +5,14 @@ using Microsoft.AspNetCore.Mvc.Filters;
|
||||
|
||||
namespace adas_core.Authentication.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies an authorization filter attribute that restricts access to decorated methods based on a required role of type <see cref="PermissionEnum.RolesType"/>.
|
||||
/// Inherits from <see cref="Attribute"/> and implements <see cref="IAuthorizationFilter"/> to participate in the authorization pipeline.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Constrained by <see cref="System.AttributeUsageAttribute"/> to <see cref="AttributeTargets.Method"/>, the attribute is configured at construction with the required <paramref name="type"/>.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=b5093e9 -->
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class AuthorizeRolesAttribute(PermissionEnum.RolesType type) : Attribute, IAuthorizationFilter
|
||||
{
|
||||
|
||||
@@ -4,6 +4,13 @@ using Microsoft.AspNetCore.Mvc.Filters;
|
||||
|
||||
namespace adas_core.Authentication.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an authorization attribute that enforces permission-based access control using the injected <see cref="IUserService"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Inherits from <see cref="Attribute"/> and implements <see cref="IAuthorizationFilter"/>, allowing it to be applied to controllers or actions and integrated into the request filtering pipeline.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=28ee847 -->
|
||||
public class AuthorizePermissionsAttribute(
|
||||
IUserService userService)
|
||||
: Attribute, IAuthorizationFilter
|
||||
|
||||
@@ -9,6 +9,14 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace adas_core.Authentication.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an authorization attribute that evaluates permissions using a configured source and an optional resource identifier header.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Extends <see cref="AuthorizeAttribute"/> and implements <see cref="IAsyncAuthorizationFilter"/> to support asynchronous authorization filtering.
|
||||
/// The primary constructor parameter <paramref name="source"/> specifies the permission source, while the optional <paramref name="resourceIdHeader"/> identifies the header that carries the resource identifier.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=e97022a -->
|
||||
public class PermissionAuthorizeAttribute(string source, string? resourceIdHeader = null)
|
||||
: AuthorizeAttribute, IAsyncAuthorizationFilter
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user