1
0
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:
Kyle Spearrin
2017-05-11 14:52:35 -04:00
parent d7f9977382
commit 21d1cd6adc
43 changed files with 318 additions and 504 deletions

View File

@ -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; }
}
}

View File

@ -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