1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

changed all OnlyOrg wording to be SingleOrg instead (#974)

* changed all OnlyOrg wording to be SingleOrg instead

* missed an OnlyOrg to change to SingleOrg
This commit is contained in:
Addison Beck 2020-10-27 10:28:41 -04:00 committed by GitHub
parent 66e44759f0
commit 0eccfb8784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 27 additions and 27 deletions

View File

@ -135,7 +135,7 @@ namespace Bit.Portal.Controllers
case PolicyType.MasterPassword:
case PolicyType.PasswordGenerator:
case PolicyType.TwoFactorAuthentication:
case PolicyType.OnlyOrg:
case PolicyType.SingleOrg:
break;
case PolicyType.RequireSso:

View File

@ -81,7 +81,7 @@ namespace Bit.Portal.Models
case PolicyType.PasswordGenerator:
existingPolicy.Data = JsonSerializer.Serialize(PasswordGeneratorDataModel, options);
break;
case PolicyType.OnlyOrg:
case PolicyType.SingleOrg:
case PolicyType.TwoFactorAuthentication:
case PolicyType.RequireSso:
break;

View File

@ -32,9 +32,9 @@ namespace Bit.Portal.Models
DescriptionKey = "PasswordGeneratorDescription";
break;
case PolicyType.OnlyOrg:
NameKey = "OnlyOrganization";
DescriptionKey = "OnlyOrganizationDescription";
case PolicyType.SingleOrg:
NameKey = "SingleOrganization";
DescriptionKey = "SingleOrganizationDescription";
break;
case PolicyType.RequireSso:

View File

@ -22,14 +22,14 @@
</div>
}
@if (Model.PolicyType == PolicyType.OnlyOrg)
@if (Model.PolicyType == PolicyType.SingleOrg)
{
<div class="callout callout-warning" role="alert">
<h3 class="callout-heading">
<i class="fa fa-warning" *ngIf="icon" aria-hidden="true"></i>
@i18nService.T("Warning")
</h3>
@i18nService.T("OnlyOrganizationPolicyWarning")
@i18nService.T("SingleOrganizationPolicyWarning")
</div>
}

View File

@ -161,7 +161,7 @@ namespace Bit.Api.Controllers
}
var policies = await _policyRepository.GetManyByUserIdAsync(user.Id);
if (policies.Any(policy => policy.Type == PolicyType.OnlyOrg))
if (policies.Any(policy => policy.Type == PolicyType.SingleOrg))
{
throw new Exception("You may not create an organization. You belong to an organization " +
"which has a policy that prohibits you from being a member of any other organization.");
@ -189,7 +189,7 @@ namespace Bit.Api.Controllers
}
var policies = await _policyRepository.GetManyByUserIdAsync(user.Id);
if (policies.Any(policy => policy.Type == PolicyType.OnlyOrg))
if (policies.Any(policy => policy.Type == PolicyType.SingleOrg))
{
throw new Exception("You may not create an organization. You belong to an organization " +
"which has a policy that prohibits you from being a member of any other organization.");

View File

@ -5,7 +5,7 @@
TwoFactorAuthentication = 0,
MasterPassword = 1,
PasswordGenerator = 2,
OnlyOrg = 3,
SingleOrg = 3,
RequireSso = 4,
}
}

View File

@ -1,6 +1,6 @@
namespace Bit.Core.Models.Mail
{
public class OrganizationUserRemovedForPolicyOnlyOrgViewModel : BaseMailModel
public class OrganizationUserRemovedForPolicySingleOrgViewModel : BaseMailModel
{
public string OrganizationName { get; set; }
}

View File

@ -539,13 +539,13 @@
<data name="RedirectBehavior" xml:space="preserve">
<value>OIDC Redirect Behavior</value>
</data>
<data name="OnlyOrganization" xml:space="preserve">
<value>Only Organization</value>
<data name="SingleOrganization" xml:space="preserve">
<value>Single Organization</value>
</data>
<data name="OnlyOrganizationDescription" xml:space="preserve">
<data name="SingleOrganizationDescription" xml:space="preserve">
<value>Restrict users from being able to join any other organizations.</value>
</data>
<data name="OnlyOrganizationPolicyWarning" xml:space="preserve">
<data name="SingleOrganizationPolicyWarning" xml:space="preserve">
<value>Organization members who are already a part of another organization will be removed from this organization and will receive an email notifying them about the change.</value>
</data>
<data name="RequireSso" xml:space="preserve">

View File

@ -28,6 +28,6 @@ namespace Bit.Core.Services
Task SendLicenseExpiredAsync(IEnumerable<string> emails, string organizationName = null);
Task SendNewDeviceLoggedInEmail(string email, string deviceType, DateTime timestamp, string ip);
Task SendRecoverTwoFactorEmail(string email, DateTime timestamp, string ip);
Task SendOrganizationUserRemovedForPolicyOnlyOrgEmailAsync(string organizationName, string email);
Task SendOrganizationUserRemovedForPolicySingleOrgEmailAsync(string organizationName, string email);
}
}

View File

@ -326,17 +326,17 @@ namespace Bit.Core.Services
await _mailDeliveryService.SendEmailAsync(message);
}
public async Task SendOrganizationUserRemovedForPolicyOnlyOrgEmailAsync(string organizationName, string email)
public async Task SendOrganizationUserRemovedForPolicySingleOrgEmailAsync(string organizationName, string email)
{
var message = CreateDefaultMessage($"You have been removed from {organizationName}", email);
var model = new OrganizationUserRemovedForPolicyOnlyOrgViewModel
var model = new OrganizationUserRemovedForPolicySingleOrgViewModel
{
OrganizationName = CoreHelpers.SanitizeForEmail(organizationName),
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
SiteName = _globalSettings.SiteName
};
await AddMessageContentAsync(message, "OrganizationUserRemovedForPolicyOnlyOrg", model);
message.Category = "OrganizationUserRemovedForPolicyOnlyOrg";
await AddMessageContentAsync(message, "OrganizationUserRemovedForPolicySingleOrg", model);
message.Category = "OrganizationUserRemovedForPolicySingleOrg";
await _mailDeliveryService.SendEmailAsync(message);
}

View File

@ -1148,12 +1148,12 @@ namespace Bit.Core.Services
var userOrgs = await _organizationUserRepository.GetManyByUserAsync(user.Id);
if (userOrgs.Any(ou => ou.OrganizationId != orgUser.OrganizationId && ou.Status != OrganizationUserStatusType.Invited))
{
if (await hasPolicyAsync(PolicyType.OnlyOrg))
if (await hasPolicyAsync(PolicyType.SingleOrg))
{
throw new BadRequestException("You may not join this organization until you leave or remove " +
"all other organizations.");
}
if (await hasPolicyAsync(PolicyType.OnlyOrg, true))
if (await hasPolicyAsync(PolicyType.SingleOrg, true))
{
throw new BadRequestException("You cannot join this organization because you are a member of " +
"an organization which forbids it");
@ -1209,8 +1209,8 @@ namespace Bit.Core.Services
throw new BadRequestException("User does not have two-step login enabled.");
}
var usingOnlyOrgPolicy = policies.Any(p => p.Type == PolicyType.OnlyOrg && p.Enabled);
if (usingOnlyOrgPolicy)
var usingSingleOrgPolicy = policies.Any(p => p.Type == PolicyType.SingleOrg && p.Enabled);
if (usingSingleOrgPolicy)
{
var userOrgs = await _organizationUserRepository.GetManyByUserAsync(user.Id);
if (userOrgs.Any(ou => ou.OrganizationId != organizationId && ou.Status != OrganizationUserStatusType.Invited))

View File

@ -76,7 +76,7 @@ namespace Bit.Core.Services
}
}
break;
case Enums.PolicyType.OnlyOrg:
case Enums.PolicyType.SingleOrg:
var userOrgs = await _organizationUserRepository.GetManyByManyUsersAsync(
removableOrgUsers.Select(ou => ou.UserId.Value));
foreach (var orgUser in removableOrgUsers)
@ -86,7 +86,7 @@ namespace Bit.Core.Services
organization = organization ?? await _organizationRepository.GetByIdAsync(policy.OrganizationId);
await organizationService.DeleteUserAsync(policy.OrganizationId, orgUser.Id,
savingUserId);
await _mailService.SendOrganizationUserRemovedForPolicyOnlyOrgEmailAsync(
await _mailService.SendOrganizationUserRemovedForPolicySingleOrgEmailAsync(
organization.Name, orgUser.Email);
}
}

View File

@ -103,7 +103,7 @@ namespace Bit.Core.Services
return Task.FromResult(0);
}
public Task SendOrganizationUserRemovedForPolicyOnlyOrgEmailAsync(string organizationName, string email)
public Task SendOrganizationUserRemovedForPolicySingleOrgEmailAsync(string organizationName, string email)
{
return Task.FromResult(0);
}