diff --git a/src/Umbraco.Core/Models/ContentEditing/UserGroupBasic.cs b/src/Umbraco.Core/Models/ContentEditing/UserGroupBasic.cs index 12ce484e59..5780214476 100644 --- a/src/Umbraco.Core/Models/ContentEditing/UserGroupBasic.cs +++ b/src/Umbraco.Core/Models/ContentEditing/UserGroupBasic.cs @@ -24,6 +24,9 @@ public class UserGroupBasic : EntityBasic, INotificationModel [DataMember(Name = "mediaStartNode")] public EntityBasic? MediaStartNode { get; set; } + [DataMember(Name = "hasAccessToAllLanguages")] + public bool HasAccessToAllLanguages { get; set; } + /// /// The number of users assigned to this group /// diff --git a/src/Umbraco.Core/Models/ContentEditing/UserGroupSave.cs b/src/Umbraco.Core/Models/ContentEditing/UserGroupSave.cs index 3722096867..a646c10337 100644 --- a/src/Umbraco.Core/Models/ContentEditing/UserGroupSave.cs +++ b/src/Umbraco.Core/Models/ContentEditing/UserGroupSave.cs @@ -34,6 +34,9 @@ public class UserGroupSave : EntityBasic, IValidatableObject [DataMember(Name = "startMediaId")] public int? StartMediaId { get; set; } + [DataMember(Name = "hasAccessToAllLanguages")] + public bool HasAccessToAllLanguages { get; set; } + /// /// The list of letters (permission codes) to assign as the default for the user group /// @@ -49,11 +52,11 @@ public class UserGroupSave : EntityBasic, IValidatableObject [DataMember(Name = "assignedPermissions")] public IDictionary>? AssignedPermissions { get; set; } - /// - /// The ids of allowed languages - /// - [DataMember(Name = "allowedLanguages")] - public IEnumerable? AllowedLanguages { get; set; } + /// + /// The ids of allowed languages + /// + [DataMember(Name = "allowedLanguages")] + public IEnumerable? AllowedLanguages { get; set; } /// /// The real persisted user group diff --git a/src/Umbraco.Core/Models/Mapping/UserMapDefinition.cs b/src/Umbraco.Core/Models/Mapping/UserMapDefinition.cs index eec5717dd3..3a04f118be 100644 --- a/src/Umbraco.Core/Models/Mapping/UserMapDefinition.cs +++ b/src/Umbraco.Core/Models/Mapping/UserMapDefinition.cs @@ -134,6 +134,7 @@ public class UserMapDefinition : IMapDefinition target.Name = source.Name; target.Permissions = source.DefaultPermissions; target.Key = source.Key; + target.HasAccessToAllLanguages = source.HasAccessToAllLanguages; var id = GetIntId(source.Id); if (id > 0) @@ -264,6 +265,7 @@ public class UserMapDefinition : IMapDefinition target.ParentId = -1; target.Path = "-1," + source.Id; target.IsSystemUserGroup = source.IsSystemUserGroup(); + target.HasAccessToAllLanguages = source.HasAccessToAllLanguages; MapUserGroupBasic(target, source.AllowedLanguages, source.AllowedSections, source.StartContentId, source.StartMediaId, context); } @@ -281,6 +283,7 @@ public class UserMapDefinition : IMapDefinition target.Path = "-1," + source.Id; target.UserCount = source.UserCount; target.IsSystemUserGroup = source.IsSystemUserGroup(); + target.HasAccessToAllLanguages = source.HasAccessToAllLanguages; MapUserGroupBasic(target, source.AllowedLanguages, source.AllowedSections, source.StartContentId, source.StartMediaId, context); } @@ -318,6 +321,7 @@ public class UserMapDefinition : IMapDefinition target.Path = "-1," + source.Id; target.UserCount = source.UserCount; target.IsSystemUserGroup = source.IsSystemUserGroup(); + target.HasAccessToAllLanguages = source.HasAccessToAllLanguages; MapUserGroupBasic(target, source.AllowedLanguages, source.AllowedSections, source.StartContentId, source.StartMediaId, context); diff --git a/src/Umbraco.Core/Models/Membership/UserGroup.cs b/src/Umbraco.Core/Models/Membership/UserGroup.cs index c3ec2a4130..7369771cbd 100644 --- a/src/Umbraco.Core/Models/Membership/UserGroup.cs +++ b/src/Umbraco.Core/Models/Membership/UserGroup.cs @@ -22,6 +22,7 @@ public class UserGroup : EntityBase, IUserGroup, IReadOnlyUserGroup private string _alias; private string? _icon; private string _name; + private bool _hasAccessToAllLanguages; private IEnumerable? _permissions; private List _sectionCollection; private List _languageCollection; @@ -102,6 +103,13 @@ public class UserGroup : EntityBase, IUserGroup, IReadOnlyUserGroup set => SetPropertyValueAndDetectChanges(value, ref _name!, nameof(Name)); } + [DataMember] + public bool HasAccessToAllLanguages + { + get => _hasAccessToAllLanguages; + set => SetPropertyValueAndDetectChanges(value, ref _hasAccessToAllLanguages, nameof(HasAccessToAllLanguages)); + } + /// /// The set of default permissions for the user group /// diff --git a/src/Umbraco.Infrastructure/Persistence/Factories/UserGroupFactory.cs b/src/Umbraco.Infrastructure/Persistence/Factories/UserGroupFactory.cs index 5edc443476..3c4546da04 100644 --- a/src/Umbraco.Infrastructure/Persistence/Factories/UserGroupFactory.cs +++ b/src/Umbraco.Infrastructure/Persistence/Factories/UserGroupFactory.cs @@ -26,6 +26,7 @@ internal static class UserGroupFactory userGroup.UpdateDate = dto.UpdateDate; userGroup.StartContentId = dto.StartContentId; userGroup.StartMediaId = dto.StartMediaId; + userGroup.HasAccessToAllLanguages = dto.HasAccessToAllLanguages; if (dto.UserGroup2AppDtos != null) { foreach (UserGroup2AppDto app in dto.UserGroup2AppDtos) @@ -61,6 +62,7 @@ internal static class UserGroupFactory Icon = entity.Icon, StartMediaId = entity.StartMediaId, StartContentId = entity.StartContentId, + HasAccessToAllLanguages = entity.HasAccessToAllLanguages, }; foreach (var app in entity.AllowedSections)