=== 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;
|
||||
|
||||
Reference in New Issue
Block a user