=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===
This commit is contained in:
@@ -13,6 +13,8 @@ namespace adas_core.Authentication.Attributes;
|
||||
/// 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 -->
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=missing_param
|
||||
/// "The primary constructor parameter 'type' is referenced via <paramref> in remarks but lacks a formal <param> tag describing its purpose." -->
|
||||
[AttributeUsage(AttributeTargets.Method)]
|
||||
public class AuthorizeRolesAttribute(PermissionEnum.RolesType type) : Attribute, IAuthorizationFilter
|
||||
{
|
||||
@@ -22,6 +24,7 @@ public class AuthorizeRolesAttribute(PermissionEnum.RolesType type) : Attribute,
|
||||
/// and otherwise responds with a forbid result when no user role starts with the permission type value.
|
||||
/// </summary>
|
||||
/// <param name="context">The authorization filter context providing access to the HTTP context and where the authorization result is assigned.</param>
|
||||
/// <!-- aidoc:v1 sig=6368c5d body=ab6a306 -->
|
||||
public void OnAuthorization(AuthorizationFilterContext context)
|
||||
{
|
||||
var user = context.HttpContext.User;
|
||||
|
||||
@@ -19,6 +19,7 @@ public class AuthorizePermissionsAttribute(
|
||||
/// Handles authorization by validating the presence of the <c>Displayid</c> request header and ensuring the authenticated user exists in the user service. If the header is missing or the user cannot be found, the request is short-circuited with a <see cref="NotFoundObjectResult"/>.
|
||||
/// </summary>
|
||||
/// <param name="context">The <see cref="AuthorizationFilterContext"/> for the current request, providing access to the HTTP context, user identity, and the ability to set the action result.</param>
|
||||
/// <!-- aidoc:v1 sig=6368c5d body=527e8e0 -->
|
||||
public void OnAuthorization(AuthorizationFilterContext context)
|
||||
{
|
||||
var user = context.HttpContext.User;
|
||||
|
||||
@@ -27,6 +27,7 @@ public class PermissionAuthorizeAttribute(string source, string? resourceIdHeade
|
||||
/// </summary>
|
||||
/// <param name="context">The <see cref="AuthorizationFilterContext"/> for the current authorization request, providing access to the HTTP context, services, and the result to set when authorization fails.</param>
|
||||
/// <exception cref="ForbbidenException">Thrown when the <see cref="IPermissionService"/> cannot be resolved from the request services.</exception>
|
||||
/// <!-- aidoc:v1 sig=2cfde77 body=c01efe9 -->
|
||||
public async Task OnAuthorizationAsync(AuthorizationFilterContext context)
|
||||
{
|
||||
// Obtener el servicio de permisos.
|
||||
|
||||
Reference in New Issue
Block a user