security: use more antiforgery tokens
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using Disco.Models.UI.Config.AuthorizationRole;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.AuthorizationRole
|
||||
{
|
||||
public class CreateModel : ConfigAuthorizationRoleCreateModel
|
||||
{
|
||||
public Disco.Models.Repository.AuthorizationRole AuthorizationRole { get; set; }
|
||||
[Required, StringLength(100)]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,15 @@
|
||||
using Disco.Models.UI.Config.DeviceBatch;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
public class CreateModel : ConfigDeviceBatchCreateModel
|
||||
{
|
||||
public Disco.Models.Repository.DeviceBatch DeviceBatch { get; set; }
|
||||
[Required, StringLength(500)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required, DisplayFormat(ApplyFormatInEditMode = true, ConvertEmptyStringToNull = true, DataFormatString = "{0:yyyy/MM/dd}", HtmlEncode = false)]
|
||||
public DateTime PurchaseDate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
using Disco.Models.UI.Config.DeviceFlag;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceFlag
|
||||
{
|
||||
public class CreateModel : ConfigDeviceFlagCreateModel
|
||||
{
|
||||
public Disco.Models.Repository.DeviceFlag DeviceFlag { get; set; }
|
||||
[Required, StringLength(100)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[StringLength(500), DataType(DataType.MultilineText)]
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
using Disco.Models.UI.Config.DeviceProfile;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceProfile
|
||||
{
|
||||
public class CreateModel : ConfigDeviceProfileCreateModel
|
||||
{
|
||||
public Disco.Models.Repository.DeviceProfile DeviceProfile { get; set; }
|
||||
[Required, StringLength(100)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[Required, StringLength(10)]
|
||||
public string ShortName { get; set; }
|
||||
|
||||
[StringLength(500), DataType(DataType.MultilineText)]
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,13 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
[CustomValidation(typeof(CreateModelValidation), "ValidateCreateModel")]
|
||||
public class CreateModel : ConfigDocumentTemplateCreateModel
|
||||
{
|
||||
public Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
|
||||
[StringLength(30), Required]
|
||||
public string Id { get; set; }
|
||||
|
||||
[StringLength(250), Required]
|
||||
public string Description { get; set; }
|
||||
[Required, StringLength(6)]
|
||||
public string Scope { get; set; }
|
||||
|
||||
[Required]
|
||||
public HttpPostedFileBase Template { get; set; }
|
||||
@@ -21,13 +27,8 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
|
||||
public List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
|
||||
|
||||
public List<string> Scopes
|
||||
{
|
||||
get
|
||||
{
|
||||
return Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
|
||||
}
|
||||
}
|
||||
public List<string> Scopes =>
|
||||
Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
|
||||
|
||||
public List<Disco.Models.Repository.JobType> GetJobTypes()
|
||||
{
|
||||
@@ -63,7 +64,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
public static ValidationResult ValidateCreateModel(CreateModel model)
|
||||
{
|
||||
|
||||
if (model.DocumentTemplate != null && model.DocumentTemplate.Scope == Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Job)
|
||||
if (model.Scope == Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.Job)
|
||||
{
|
||||
if (model.Types != null && model.SubTypes != null)
|
||||
{
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
using Disco.Models.Services.Documents;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.UI.Config.DocumentTemplate;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
{
|
||||
public class CreatePackageModel : ConfigDocumentTemplateCreatePackageModel
|
||||
{
|
||||
public DocumentTemplatePackage Package { get; set; }
|
||||
[StringLength(30), Required]
|
||||
public string Id { get; set; }
|
||||
[StringLength(250), Required]
|
||||
public string Description { get; set; }
|
||||
[Required]
|
||||
public AttachmentTypes Scope { get; set; }
|
||||
|
||||
public List<string> Scopes
|
||||
{
|
||||
get
|
||||
{
|
||||
return Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
|
||||
}
|
||||
}
|
||||
=> Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using Disco.Models.UI.Config.DocumentTemplate;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Documents.ManagedGroups;
|
||||
using Disco.Services.Expressions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -36,7 +37,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
public DocumentTemplateDevicesManagedGroup DevicesLinkedGroup { get; set; }
|
||||
public DocumentTemplateUsersManagedGroup UsersLinkedGroup { get; set; }
|
||||
|
||||
public string BulkGenerateDownloadId { get; set; }
|
||||
public Guid? BulkGenerateDownloadId { get; set; }
|
||||
|
||||
public string BulkGenerateDownloadFilename { get; set; }
|
||||
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
using Disco.Models.UI.Config.JobQueue;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.JobQueue
|
||||
{
|
||||
public class CreateModel : ConfigJobQueueCreateModel
|
||||
{
|
||||
public Disco.Models.Repository.JobQueue JobQueue { get; set; }
|
||||
[Required, StringLength(100)]
|
||||
public string Name { get; set; }
|
||||
[StringLength(500), DataType(DataType.MultilineText)]
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
using Disco.Models.UI.Config.UserFlag;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.UserFlag
|
||||
{
|
||||
public class CreateModel : ConfigUserFlagCreateModel
|
||||
{
|
||||
public Disco.Models.Repository.UserFlag UserFlag { get; set; }
|
||||
[Required, StringLength(100)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[StringLength(500), DataType(DataType.MultilineText)]
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user