mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 17:12:49 -05:00
collection user refactor
This commit is contained in:
@ -1,35 +0,0 @@
|
||||
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; }
|
||||
}
|
||||
}
|
@ -12,15 +12,6 @@ namespace Bit.Core.Models.Api
|
||||
public string Id { get; set; }
|
||||
public bool ReadOnly { get; set; }
|
||||
|
||||
public CollectionUser ToCollectionUser()
|
||||
{
|
||||
return new CollectionUser
|
||||
{
|
||||
ReadOnly = ReadOnly,
|
||||
CollectionId = new Guid(Id)
|
||||
};
|
||||
}
|
||||
|
||||
public SelectionReadOnly ToSelectionReadOnly()
|
||||
{
|
||||
return new SelectionReadOnly
|
||||
|
Reference in New Issue
Block a user