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
policyNamestringName of the authorization policy.
httpMethodHttpMethodHTTP method the rule applies to (any by default).
Properties
HttpMethod
HTTP method the rule applies to.
public HttpMethod HttpMethod { get; }
Property Value
PolicyName
Name of the authorization policy.
public string PolicyName { get; }