fix 权限导入控制来源类型
This commit is contained in:
@@ -31,23 +31,11 @@ public class DevicePermissionsAssignToDeviceRequest : IValidatableObject
|
||||
/// </summary>
|
||||
public bool IsDelete { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// AssignType == AssignTypeEnumType.Department 需要传入
|
||||
/// </summary>
|
||||
public string TenantId { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (AssignType == AssignTypeEnumType.Department)
|
||||
if (AssignType != AssignTypeEnumType.User)
|
||||
{
|
||||
if (TenantId.IsEmpty())
|
||||
{
|
||||
yield return new ValidationResult("请明确具体的厂区", new[] { nameof(TenantId) });
|
||||
}
|
||||
}
|
||||
else if (AssignType == AssignTypeEnumType.Role)
|
||||
{
|
||||
yield return new ValidationResult("暂不支持角色分配", new[] { nameof(AssignType) });
|
||||
yield return new ValidationResult("仅支持导入档案人员", new[] { nameof(AssignType) });
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user