Table of Contents

Class AuthorizedOnlyAttribute

Namespace
Magicalizer.Api.Dto.Abstractions
Assembly
Magicalizer.Api.Dto.Abstractions.dll

Authorization rule of a DTO controller: the user has to satisfy the policy to call the API methods.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class AuthorizedOnlyAttribute : Attribute
Inheritance
AuthorizedOnlyAttribute
Inherited Members

Constructors

AuthorizedOnlyAttribute(string, HttpMethod)

Creates an authorization rule for the policy and HTTP method.

public AuthorizedOnlyAttribute(string policyName, HttpMethod httpMethod = HttpMethod.Any)

Parameters

policyName string

Name of the authorization policy.

httpMethod HttpMethod

HTTP method the rule applies to (any by default).

Properties

HttpMethod

HTTP method the rule applies to.

public HttpMethod HttpMethod { get; }

Property Value

HttpMethod

PolicyName

Name of the authorization policy.

public string PolicyName { get; }

Property Value

string