mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 10:54:50 +08:00
Basic fix for Work Item 16558 - Adding too long role name causes page error. Added Data annotation to limit role name to 255 chars to avoid YSOD.
This commit is contained in:
@@ -4,7 +4,7 @@ using Orchard.Security.Permissions;
|
||||
|
||||
namespace Orchard.Roles.ViewModels {
|
||||
public class RoleCreateViewModel {
|
||||
[Required]
|
||||
[Required, StringLength(255)]
|
||||
public string Name { get; set; }
|
||||
public IDictionary<string, IEnumerable<Permission>> FeaturePermissions { get; set; }
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ using Orchard.Security.Permissions;
|
||||
namespace Orchard.Roles.ViewModels {
|
||||
public class RoleEditViewModel {
|
||||
public int Id { get; set; }
|
||||
[Required]
|
||||
[Required, StringLength(255)]
|
||||
public string Name { get; set; }
|
||||
public IDictionary<string, IEnumerable<Permission>> RoleCategoryPermissions { get; set; }
|
||||
public IEnumerable<string> CurrentPermissions { get; set; }
|
||||
|
Reference in New Issue
Block a user