| | | 1 | | namespace ProjectTemplate.Web.Authentication.Options; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Provides configurable authorization policy options for the application. |
| | | 5 | | /// </summary> |
| | | 6 | | public sealed class ApplicationAuthorizationOptions |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Gets the configuration section name used to bind application authorization settings. |
| | | 10 | | /// </summary> |
| | | 11 | | public const string SectionName = "ProjectTemplate:Authorization"; |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Gets or sets a value indicating whether routed endpoints without authorization metadata require an authenticated |
| | | 15 | | /// </summary> |
| | 1286 | 16 | | public bool RequireAuthenticatedUserByDefault { get; set; } = true; |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Gets or sets the claim type used to evaluate role-based authorization policies. |
| | | 20 | | /// </summary> |
| | 1470 | 21 | | public string RoleClaimType { get; set; } = "application:role"; |
| | | 22 | | |
| | | 23 | | /// <summary> |
| | | 24 | | /// Gets or sets the claim type used to evaluate permission-based authorization policies. |
| | | 25 | | /// </summary> |
| | 1470 | 26 | | public string PermissionClaimType { get; set; } = "application:permission"; |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Gets or sets the role values that satisfy the administrator authorization policy. |
| | | 30 | | /// </summary> |
| | 1728 | 31 | | public string[] AdministratorRoles { get; set; } = ["administrator"]; |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// Gets or sets the permission values that satisfy the manage application authorization policy. |
| | | 35 | | /// </summary> |
| | 1728 | 36 | | public string[] ManageApplicationPermissions { get; set; } = ["application.manage"]; |
| | | 37 | | } |