#region ========================================================================= USING ===================================================================================== using Lumina.Domain.Common.Primitives; #endregion namespace Lumina.Application.Common.Errors; /// /// Application authorization related error types. /// public static partial class Errors { /// /// Error types for application authorization operations. /// public static class Authorization { /// /// Gets the error that reports that the caller is not authorized to perform the operation. /// public static Error NotAuthorized => Error.Unauthorized(description: nameof(NotAuthorized)); /// /// Gets the error that reports that the administrator account has already been created. /// public static Error AdminAccountAlreadyCreated => Error.Conflict(description: nameof(AdminAccountAlreadyCreated)); /// /// Gets the error that reports that the administrator account does not exist. /// public static Error AdminAccountNotFound => Error.NotFound(description: nameof(AdminAccountNotFound)); /// /// Gets the error that reports that the administrator role does not exist. /// public static Error AdminRoleNotFound => Error.NotFound(description: nameof(AdminRoleNotFound)); /// /// Gets the error that reports that the administrator role cannot be deleted. /// public static Error AdminRoleCannotBeDeleted => Error.Forbidden(description: nameof(AdminRoleCannotBeDeleted)); /// /// Gets the error that reports that a role does not exist. /// public static Error RoleNotFound => Error.NotFound(description: nameof(RoleNotFound)); /// /// Gets the error that reports that a permission does not exist. /// public static Error PermissionNotFound => Error.NotFound(description: nameof(PermissionNotFound)); /// /// Gets the error that reports that a permission already exists. /// public static Error PermissionAlreadyExists => Error.Conflict(description: nameof(PermissionAlreadyExists)); /// /// Gets the error that reports that a role already exists. /// public static Error RoleAlreadyExists => Error.Conflict(description: nameof(RoleAlreadyExists)); /// /// Gets the error that reports that a role identifier cannot be empty. /// public static Error RoleIdCannotBeEmpty => Error.Validation(description: nameof(RoleIdCannotBeEmpty)); /// /// Gets the error that reports that a permissions list cannot be . /// public static Error PermissionsListCannotBeNull => Error.Validation(description: nameof(PermissionsListCannotBeNull)); /// /// Gets the error that reports that a permissions list cannot be empty. /// public static Error PermissionsListCannotBeEmpty => Error.Validation(description: nameof(PermissionsListCannotBeEmpty)); /// /// Gets the error that reports that a permission identifier cannot be empty. /// public static Error PermissionIdCannotBeEmpty => Error.Validation(description: nameof(PermissionIdCannotBeEmpty)); /// /// Gets the error that reports that a role name cannot be empty. /// public static Error RoleNameCannotBeEmpty => Error.Validation(description: nameof(RoleNameCannotBeEmpty)); /// /// Gets the error that reports that a role name cannot be . /// public static Error RoleNameCannotBeNull => Error.Validation(description: nameof(RoleNameCannotBeNull)); /// /// Gets the error that reports that the last administrator account cannot be removed. /// public static Error CannotRemoveLastAdmin => Error.Forbidden(description: nameof(CannotRemoveLastAdmin)); /// /// Gets the error that reports that a user must have a role or direct permissions. /// public static Error UserMustHaveRoleOrDirectPermissions => Error.Forbidden(description: nameof(UserMustHaveRoleOrDirectPermissions)); } }