1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00

dotnet format

This commit is contained in:
Thomas Rittson 2024-11-18 16:47:13 +10:00
parent f661f9599b
commit cbdbc07a48
No known key found for this signature in database
GPG Key ID: CDDDA03861C35E27
3 changed files with 7 additions and 9 deletions

View File

@ -1,5 +1,4 @@
using System.Security.Claims; using Bit.Core.AdminConsole.OrganizationFeatures.Shared.Authorization;
using Bit.Core.AdminConsole.OrganizationFeatures.Shared.Authorization;
using Bit.Core.Context; using Bit.Core.Context;
using Bit.Core.Enums; using Bit.Core.Enums;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
@ -33,8 +32,8 @@ public class VaultExportAuthorizationHandler(ICurrentContext currentContext)
} }
private bool CanExportAll(CurrentContextOrganization organization) => organization is private bool CanExportAll(CurrentContextOrganization organization) => organization is
{ Type: OrganizationUserType.Owner or OrganizationUserType.Admin } or { Type: OrganizationUserType.Owner or OrganizationUserType.Admin } or
{ Type: OrganizationUserType.Custom, Permissions.AccessImportExport: true }; { Type: OrganizationUserType.Custom, Permissions.AccessImportExport: true };
private bool CanExportPartial(CurrentContextOrganization organization) => organization is not null; private bool CanExportPartial(CurrentContextOrganization organization) => organization is not null;
} }

View File

@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization.Infrastructure;
using Microsoft.AspNetCore.Authorization.Infrastructure;
namespace Bit.Core.Tools.Authorization; namespace Bit.Core.Tools.Authorization;

View File

@ -15,7 +15,7 @@ namespace Bit.Api.Test.Tools.Authorization;
[SutProviderCustomize] [SutProviderCustomize]
public class VaultExportAuthorizationHandlerTests public class VaultExportAuthorizationHandlerTests
{ {
public static IEnumerable<object[]> CanExportEntireVault => new[] public static IEnumerable<CurrentContextOrganization[]> CanExportEntireVault => new[]
{ {
new CurrentContextOrganization { Type = OrganizationUserType.Owner }, new CurrentContextOrganization { Type = OrganizationUserType.Owner },
new CurrentContextOrganization { Type = OrganizationUserType.Admin }, new CurrentContextOrganization { Type = OrganizationUserType.Admin },
@ -23,7 +23,7 @@ public class VaultExportAuthorizationHandlerTests
{ {
Type = OrganizationUserType.Custom, Permissions = new Permissions { AccessImportExport = true } Type = OrganizationUserType.Custom, Permissions = new Permissions { AccessImportExport = true }
} }
}.Select(org => new []{org}); }.Select(org => new[] { org });
[Theory] [Theory]
[BitMemberAutoData(nameof(CanExportEntireVault))] [BitMemberAutoData(nameof(CanExportEntireVault))]
@ -46,7 +46,7 @@ public class VaultExportAuthorizationHandlerTests
{ {
Type = OrganizationUserType.Custom, Permissions = FlipPermissions(new Permissions { AccessImportExport = true }) Type = OrganizationUserType.Custom, Permissions = FlipPermissions(new Permissions { AccessImportExport = true })
} }
}.Select(org => new []{org}); }.Select(org => new[] { org });
[Theory] [Theory]
[BitMemberAutoData(nameof(CannotExportEntireVault))] [BitMemberAutoData(nameof(CannotExportEntireVault))]