1
0
mirror of https://github.com/bitwarden/server synced 2026-01-08 03:23:20 +00:00
Files
server/src/Api/Models/Public/Request/GroupCreateUpdateRequestModel.cs

31 lines
820 B
C#

using System;
using System.Collections.Generic;
using Bit.Core.Entities;
namespace Bit.Api.Models.Public.Request
{
public class GroupCreateUpdateRequestModel : GroupBaseModel
{
/// <summary>
/// The associated collections that this group can access.
/// </summary>
public IEnumerable<AssociationWithPermissionsRequestModel> Collections { get; set; }
public Group ToGroup(Guid orgId)
{
return ToGroup(new Group
{
OrganizationId = orgId
});
}
public Group ToGroup(Group existingGroup)
{
existingGroup.Name = Name;
existingGroup.AccessAll = AccessAll.Value;
existingGroup.ExternalId = ExternalId;
return existingGroup;
}
}
}