using xModels.Base;
using xIdentityModels.Constants;
using System.ComponentModel.DataAnnotations;
namespace xIdentityModels.Models
{
///
/// a Policy Definition Model which can be converted to AuthorizationPolicy ...
///
public class XPolicyDefinition : XBaseIntIDEntity
{
///
/// Unique Policy Name, e.g. enabledEditorPolicy ...
///
[Required]
[StringLength(200)]
public string Name { get; set; }
///
/// Display Name ...
///
[StringLength(255)]
public string DisplayName { get; set; }
///
/// Policy Kind ...
///
public XPolicyKind Kind { get; set; } = XPolicyKind.RoleBased;
///
/// Comma Separated Role Names (explicit list) ...
///
public string RequiredRoles { get; set; }
///
/// if provided, all Roles with Weight >= MinRoleWeight will be Injected ...
///
public int? MinRoleWeight { get; set; }
///
/// Comma Separated Scope Names ...
///
public string RequiredScopes { get; set; }
///
/// Json Array of { "Type": "...", "Values": ["..."] } ...
///
public string RequiredClaims { get; set; }
///
/// Requires IsBanned=false and IsEnabled=true Claims ...
///
public bool RequireEnabledUser { get; set; }
///
/// Requires Authenticated User ...
///
public bool RequireAuthenticatedUser { get; set; } = true;
///
/// Is Enabled ...
///
public bool IsEnabled { get; set; } = true;
///
/// Seeded from Constants, cannot be removed ...
///
public bool IsSystem { get; set; }
}
}