mirror of
https://github.com/bitwarden/server
synced 2025-12-22 11:13:27 +00:00
Move request/response models (#1754)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Bit.Core.Models.Table;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user