maps name and icon for user groups
This commit is contained in:
@@ -7,6 +7,8 @@ namespace Umbraco.Core.Models.Membership
|
||||
/// </summary>
|
||||
public interface IReadOnlyUserGroup
|
||||
{
|
||||
string Name { get; }
|
||||
string Icon { get; }
|
||||
int Id { get; }
|
||||
int StartContentId { get; }
|
||||
int StartMediaId { get; }
|
||||
|
||||
@@ -5,8 +5,10 @@ namespace Umbraco.Core.Models.Membership
|
||||
{
|
||||
public class ReadOnlyUserGroup : IReadOnlyUserGroup, IEquatable<ReadOnlyUserGroup>
|
||||
{
|
||||
public ReadOnlyUserGroup(int id, int startContentId, int startMediaId, string @alias, IEnumerable<string> allowedSections)
|
||||
public ReadOnlyUserGroup(int id, string name, string icon, int startContentId, int startMediaId, string @alias, IEnumerable<string> allowedSections)
|
||||
{
|
||||
Name = name;
|
||||
Icon = icon;
|
||||
Id = id;
|
||||
StartContentId = startContentId;
|
||||
StartMediaId = startMediaId;
|
||||
@@ -15,6 +17,8 @@ namespace Umbraco.Core.Models.Membership
|
||||
}
|
||||
|
||||
public int Id { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
public string Icon { get; private set; }
|
||||
public int StartContentId { get; private set; }
|
||||
public int StartMediaId { get; private set; }
|
||||
public string Alias { get; private set; }
|
||||
|
||||
@@ -7,12 +7,12 @@ namespace Umbraco.Core.Models.Membership
|
||||
{
|
||||
public static IReadOnlyUserGroup ToReadOnlyGroup(this IUserGroup group)
|
||||
{
|
||||
return new ReadOnlyUserGroup(group.Id, group.StartContentId, group.StartMediaId, group.Alias, group.AllowedSections);
|
||||
return new ReadOnlyUserGroup(group.Id, group.Name, group.Icon, group.StartContentId, group.StartMediaId, group.Alias, group.AllowedSections);
|
||||
}
|
||||
|
||||
public static IReadOnlyUserGroup ToReadOnlyGroup(this UserGroupDto group)
|
||||
{
|
||||
return new ReadOnlyUserGroup(group.Id, group.StartContentId, group.StartMediaId, group.Alias, group.UserGroup2AppDtos.Select(x => x.AppAlias).ToArray());
|
||||
return new ReadOnlyUserGroup(group.Id, group.Name, group.Icon, group.StartContentId, group.StartMediaId, group.Alias, group.UserGroup2AppDtos.Select(x => x.AppAlias).ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,6 +89,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
config.CreateMap<IReadOnlyUserGroup, UserGroupDisplay>()
|
||||
.ForMember(detail => detail.StartContentId, opt => opt.Ignore())
|
||||
.ForMember(detail => detail.StartMediaId, opt => opt.Ignore())
|
||||
.ForMember(detail => detail.Key, opt => opt.Ignore())
|
||||
.ForMember(detail => detail.Sections, opt => opt.Ignore())
|
||||
.ForMember(detail => detail.Notifications, opt => opt.Ignore())
|
||||
.ForMember(detail => detail.Udi, opt => opt.Ignore())
|
||||
|
||||
Reference in New Issue
Block a user