|
|
|
|
@ -1,40 +1,48 @@
@@ -1,40 +1,48 @@
|
|
|
|
|
using Bit.Core.Models.Table; |
|
|
|
|
using System; |
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Models.Api |
|
|
|
|
{ |
|
|
|
|
public class OrganizationUserInviteRequestModel |
|
|
|
|
{ |
|
|
|
|
[Required] |
|
|
|
|
[EmailAddress] |
|
|
|
|
public string Email { get; set; } |
|
|
|
|
public Enums.OrganizationUserType Type { get; set; } |
|
|
|
|
[Required] |
|
|
|
|
public Enums.OrganizationUserType? Type { get; set; } |
|
|
|
|
public IEnumerable<OrganizationUserSubvaultRequestModel> Subvaults { get; set; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class OrganizationUserAcceptRequestModel |
|
|
|
|
{ |
|
|
|
|
[Required] |
|
|
|
|
public string Token { get; set; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class OrganizationUserConfirmRequestModel |
|
|
|
|
{ |
|
|
|
|
[Required] |
|
|
|
|
public string Key { get; set; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class OrganizationUserUpdateRequestModel |
|
|
|
|
{ |
|
|
|
|
public Enums.OrganizationUserType Type { get; set; } |
|
|
|
|
[Required] |
|
|
|
|
public Enums.OrganizationUserType? Type { get; set; } |
|
|
|
|
public IEnumerable<OrganizationUserSubvaultRequestModel> Subvaults { get; set; } |
|
|
|
|
|
|
|
|
|
public OrganizationUser ToOrganizationUser(OrganizationUser existingUser) |
|
|
|
|
{ |
|
|
|
|
existingUser.Type = Type; |
|
|
|
|
existingUser.Type = Type.Value; |
|
|
|
|
return existingUser; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class OrganizationUserSubvaultRequestModel |
|
|
|
|
{ |
|
|
|
|
[Required] |
|
|
|
|
public string SubvaultId { get; set; } |
|
|
|
|
public bool Admin { get; set; } |
|
|
|
|
public bool ReadOnly { get; set; } |
|
|
|
|
@ -44,14 +52,10 @@ namespace Bit.Core.Models.Api
@@ -44,14 +52,10 @@ namespace Bit.Core.Models.Api
|
|
|
|
|
var subvault = new SubvaultUser |
|
|
|
|
{ |
|
|
|
|
Admin = Admin, |
|
|
|
|
ReadOnly = ReadOnly |
|
|
|
|
ReadOnly = ReadOnly, |
|
|
|
|
SubvaultId = new Guid(SubvaultId) |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if(!string.IsNullOrWhiteSpace(SubvaultId)) |
|
|
|
|
{ |
|
|
|
|
subvault.SubvaultId = new Guid(SubvaultId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return subvault; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|