1
0
mirror of https://github.com/bitwarden/server synced 2025-12-17 16:53:23 +00:00

AC Team code ownership moves - Api project (#3351)

This commit is contained in:
Thomas Rittson
2023-10-19 01:27:56 +10:00
committed by GitHub
parent d230b10f82
commit 37e9d70bee
62 changed files with 109 additions and 89 deletions

View File

@@ -0,0 +1,44 @@
using System.ComponentModel.DataAnnotations;
using Bit.Api.Auth.Models.Public.Response;
using Bit.Api.Models.Public.Response;
using Bit.Core.Entities;
using Bit.Core.Models.Data;
namespace Bit.Api.AdminConsole.Public.Models.Response;
/// <summary>
/// A user group.
/// </summary>
public class GroupResponseModel : GroupBaseModel, IResponseModel
{
public GroupResponseModel(Group group, IEnumerable<CollectionAccessSelection> collections)
{
if (group == null)
{
throw new ArgumentNullException(nameof(group));
}
Id = group.Id;
Name = group.Name;
AccessAll = group.AccessAll;
ExternalId = group.ExternalId;
Collections = collections?.Select(c => new AssociationWithPermissionsResponseModel(c));
}
/// <summary>
/// String representing the object's type. Objects of the same type share the same properties.
/// </summary>
/// <example>group</example>
[Required]
public string Object => "group";
/// <summary>
/// The group's unique identifier.
/// </summary>
/// <example>539a36c5-e0d2-4cf9-979e-51ecf5cf6593</example>
[Required]
public Guid Id { get; set; }
/// <summary>
/// The associated collections that this group can access.
/// </summary>
public IEnumerable<AssociationWithPermissionsResponseModel> Collections { get; set; }
}