1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-13 09:08:17 -05:00
bitwarden/src/Core/Models/Api/Request/CollectionUserRequestModel.cs
2017-04-27 09:39:21 -04:00

36 lines
934 B
C#

using System;
using Bit.Core.Models.Table;
using System.Collections.Generic;
using System.Linq;
namespace Bit.Core.Models.Api
{
public class CollectionUserCollectionRequestModel
{
public string UserId { get; set; }
public IEnumerable<Collection> Collections { get; set; }
public IEnumerable<CollectionUser> ToCollectionUsers()
{
return Collections.Select(c => new CollectionUser
{
OrganizationUserId = new Guid(UserId),
CollectionId = new Guid(c.CollectionId),
ReadOnly = c.ReadOnly
});
}
public class Collection
{
public string CollectionId { get; set; }
public bool ReadOnly { get; set; }
}
}
public class CollectionUserUserRequestModel
{
public string UserId { get; set; }
public bool ReadOnly { get; set; }
}
}