mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
Allow Resending Provider Setup Emails From The Admin Portal (#1497)
* Added a button for resending provider setup emails * Fixed a case typo in a stored procedure * Turned a couple lines of code into a method call * Added service level validation against inviting users for MSP invites * Code review improvements for provider invites created a factory for provider user invites wrote tests for provider invite permissions" * changed a few exception types
This commit is contained in:
@ -1,19 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Bit.Core.Enums.Provider;
|
||||
using Bit.Core.Models.Api;
|
||||
using Bit.Core.Models.Data;
|
||||
|
||||
namespace Bit.Core.Models.Business.Provider
|
||||
{
|
||||
public class ProviderUserInvite
|
||||
public class ProviderUserInvite<T>
|
||||
{
|
||||
public IEnumerable<string> Emails { get; set; }
|
||||
public IEnumerable<T> UserIdentifiers { get; set; }
|
||||
public ProviderUserType Type { get; set; }
|
||||
public Guid InvitingUserId { get; set; }
|
||||
public Guid ProviderId { get; set; }
|
||||
}
|
||||
|
||||
public ProviderUserInvite(ProviderUserInviteRequestModel requestModel)
|
||||
public static class ProviderUserInviteFactory
|
||||
{
|
||||
public static ProviderUserInvite<string> CreateIntialInvite(IEnumerable<string> inviteeEmails, ProviderUserType type, Guid invitingUserId, Guid providerId)
|
||||
{
|
||||
Emails = requestModel.Emails;
|
||||
Type = requestModel.Type.Value;
|
||||
return new ProviderUserInvite<string>
|
||||
{
|
||||
UserIdentifiers = inviteeEmails,
|
||||
Type = type,
|
||||
InvitingUserId = invitingUserId,
|
||||
ProviderId = providerId
|
||||
};
|
||||
}
|
||||
|
||||
public static ProviderUserInvite<Guid> CreateReinvite(IEnumerable<Guid> inviteeUserIds, Guid invitingUserId, Guid providerId)
|
||||
{
|
||||
return new ProviderUserInvite<Guid>
|
||||
{
|
||||
UserIdentifiers = inviteeUserIds,
|
||||
InvitingUserId = invitingUserId,
|
||||
ProviderId = providerId
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user