| File: OperationAuthorizationRequirement.cs | Web Access |
| Project: src\aspnetcore\src\Security\Authorization\Core\src\Microsoft.AspNetCore.Authorization.csproj (Microsoft.AspNetCore.Authorization) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace Microsoft.AspNetCore.Authorization.Infrastructure; /// <summary> /// A helper class to provide a useful <see cref="IAuthorizationRequirement"/> which /// contains a name. /// </summary> public class OperationAuthorizationRequirement : IAuthorizationRequirement { /// <summary> /// The name of this instance of <see cref="IAuthorizationRequirement"/>. /// </summary> public string Name { get; set; } = default!; /// <summary> /// Returns a string representation of the requirement. /// </summary> /// <returns>A description of the named operation requirement.</returns> public override string ToString() { return $"{nameof(OperationAuthorizationRequirement)}:Name={Name}"; } }