V9: Fix granular permissions for user groups (#11577)
* Fixes the treepicker for granular permissions to use a select callback instead of submit with the full selection * Introduced UserGroup2NodeDto table, to allow users to save empty arrays of permissions * Cleanup * Fixed null issue in audit logging * Fixed migration * Fixed GetDeleteClauses * Fixes for SqlCE, do not run multiple comments on one sql request * Align behavior between content>permissions and usergroups>granularPpermissions - It is now possible to save default values in content>permissions like in usergroups>granularPpermissions - It is now possible to differentiate between we save an empty collection and we remove the granular permissions in content>permissions * Fix comments Co-authored-by: Andy Butland <abutland73@gmail.com> Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
committed by
GitHub
parent
958cd03b00
commit
bfd17846b7
@@ -10,7 +10,7 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
|
||||
/// Used to assign user group permissions to a content node
|
||||
/// </summary>
|
||||
[DataContract(Name = "contentPermission", Namespace = "")]
|
||||
public class UserGroupPermissionsSave : IValidatableObject
|
||||
public class UserGroupPermissionsSave
|
||||
{
|
||||
public UserGroupPermissionsSave()
|
||||
{
|
||||
@@ -28,13 +28,5 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
|
||||
/// </summary>
|
||||
[DataMember(Name = "permissions")]
|
||||
public IDictionary<int, IEnumerable<string>> AssignedPermissions { get; set; }
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
if (AssignedPermissions.SelectMany(x => x.Value).Any(x => x.IsNullOrWhiteSpace()))
|
||||
{
|
||||
yield return new ValidationResult("A permission value cannot be null or empty", new[] { "Permissions" });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user