Add hasAccessToAllLanguages to user groups and map
This commit is contained in:
@@ -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; }
|
||||
|
||||
/// <summary>
|
||||
/// The number of users assigned to this group
|
||||
/// </summary>
|
||||
|
||||
@@ -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; }
|
||||
|
||||
/// <summary>
|
||||
/// The list of letters (permission codes) to assign as the default for the user group
|
||||
/// </summary>
|
||||
@@ -49,11 +52,11 @@ public class UserGroupSave : EntityBasic, IValidatableObject
|
||||
[DataMember(Name = "assignedPermissions")]
|
||||
public IDictionary<int, IEnumerable<string>>? AssignedPermissions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The ids of allowed languages
|
||||
/// </summary>
|
||||
[DataMember(Name = "allowedLanguages")]
|
||||
public IEnumerable<int>? AllowedLanguages { get; set; }
|
||||
/// <summary>
|
||||
/// The ids of allowed languages
|
||||
/// </summary>
|
||||
[DataMember(Name = "allowedLanguages")]
|
||||
public IEnumerable<int>? AllowedLanguages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The real persisted user group
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ public class UserGroup : EntityBase, IUserGroup, IReadOnlyUserGroup
|
||||
private string _alias;
|
||||
private string? _icon;
|
||||
private string _name;
|
||||
private bool _hasAccessToAllLanguages;
|
||||
private IEnumerable<string>? _permissions;
|
||||
private List<string> _sectionCollection;
|
||||
private List<int> _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));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The set of default permissions for the user group
|
||||
/// </summary>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user