# Class AuthorizeRolesAttribute

Namespace
  adas_core.Authentication.Attributes

Assembly
  adas-core.Authentication.dll

    [AttributeUsage(AttributeTargets.Method)]
    public class AuthorizeRolesAttribute : Attribute, IAuthorizationFilter, IFilterMetadata

Inheritance
  object
  Attribute
  AuthorizeRolesAttribute

Implements
  IAuthorizationFilter
  IFilterMetadata

Inherited Members
  Attribute.Equals(object)
  Attribute.GetCustomAttribute(Assembly, Type)
  Attribute.GetCustomAttribute(Assembly, Type, bool)
  Attribute.GetCustomAttribute(MemberInfo, Type)
  Attribute.GetCustomAttribute(MemberInfo, Type, bool)
  Attribute.GetCustomAttribute(Module, Type)
  Attribute.GetCustomAttribute(Module, Type, bool)
  Attribute.GetCustomAttribute(ParameterInfo, Type)
  Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
  Attribute.GetCustomAttributes(Assembly)
  Attribute.GetCustomAttributes(Assembly, bool)
  Attribute.GetCustomAttributes(Assembly, Type)
  Attribute.GetCustomAttributes(Assembly, Type, bool)
  Attribute.GetCustomAttributes(MemberInfo)
  Attribute.GetCustomAttributes(MemberInfo, bool)
  Attribute.GetCustomAttributes(MemberInfo, Type)
  Attribute.GetCustomAttributes(MemberInfo, Type, bool)
  Attribute.GetCustomAttributes(Module)
  Attribute.GetCustomAttributes(Module, bool)
  Attribute.GetCustomAttributes(Module, Type)
  Attribute.GetCustomAttributes(Module, Type, bool)
  Attribute.GetCustomAttributes(ParameterInfo)
  Attribute.GetCustomAttributes(ParameterInfo, bool)
  Attribute.GetCustomAttributes(ParameterInfo, Type)
  Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
  Attribute.GetHashCode()
  Attribute.IsDefaultAttribute()
  Attribute.IsDefined(Assembly, Type)
  Attribute.IsDefined(Assembly, Type, bool)
  Attribute.IsDefined(MemberInfo, Type)
  Attribute.IsDefined(MemberInfo, Type, bool)
  Attribute.IsDefined(Module, Type)
  Attribute.IsDefined(Module, Type, bool)
  Attribute.IsDefined(ParameterInfo, Type)
  Attribute.IsDefined(ParameterInfo, Type, bool)
  Attribute.Match(object)
  Attribute.TypeId
  object.Equals(object, object)
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Constructors

### AuthorizeRolesAttribute(RolesType)

    public AuthorizeRolesAttribute(PermissionEnum.RolesType type)

#### Parameters

`type` PermissionEnum.RolesType

## Methods

### OnAuthorization(AuthorizationFilterContext)

Performs authorization by ensuring the current user is authenticated and has a role matching the required permission type. Responds with an unauthorized result when no user is authenticated, bypasses role checking for the AuthSome permission type, and otherwise responds with a forbid result when no user role starts with the permission type value.

    public void OnAuthorization(AuthorizationFilterContext context)

#### Parameters

`context` AuthorizationFilterContext

  The authorization filter context providing access to the HTTP context and where the authorization result is assigned.