18 lines
702 B
C#
18 lines
702 B
C#
using Umbraco.Core.Models.Rdbms;
|
|
using System.Linq;
|
|
|
|
namespace Umbraco.Core.Models.Membership
|
|
{
|
|
internal static class UserGroupExtensions
|
|
{
|
|
public static IReadOnlyUserGroup ToReadOnlyGroup(this IUserGroup group)
|
|
{
|
|
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.Name, group.Icon, group.StartContentId, group.StartMediaId, group.Alias, group.UserGroup2AppDtos.Select(x => x.AppAlias).ToArray());
|
|
}
|
|
}
|
|
} |