mirror of
https://github.com/bitwarden/server.git
synced 2025-07-03 17:12:49 -05:00
Use reflection to test permission combinations
This commit is contained in:
@ -3,7 +3,7 @@ using Bit.Api.AdminConsole.Authorization;
|
||||
using Bit.Core.Context;
|
||||
using Bit.Core.Entities;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Data;
|
||||
using Bit.Core.Test.AdminConsole.Helpers;
|
||||
using Bit.Core.Utilities;
|
||||
using Bit.Test.Common.AutoFixture.Attributes;
|
||||
using Bit.Test.Common.Helpers;
|
||||
@ -43,7 +43,7 @@ public class OrganizationClaimsExtensionsTests
|
||||
];
|
||||
}
|
||||
|
||||
var permissions = GetTestCustomPermissions();
|
||||
var permissions = PermissionsHelpers.GetAllPermissions();
|
||||
foreach (var permission in permissions)
|
||||
{
|
||||
yield return
|
||||
@ -57,20 +57,4 @@ public class OrganizationClaimsExtensionsTests
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<Permissions> GetTestCustomPermissions()
|
||||
{
|
||||
yield return new Permissions { AccessEventLogs = true };
|
||||
yield return new Permissions { AccessImportExport = true };
|
||||
yield return new Permissions { AccessReports = true };
|
||||
yield return new Permissions { CreateNewCollections = true };
|
||||
yield return new Permissions { EditAnyCollection = true };
|
||||
yield return new Permissions { DeleteAnyCollection = true };
|
||||
yield return new Permissions { ManageGroups = true };
|
||||
yield return new Permissions { ManagePolicies = true };
|
||||
yield return new Permissions { ManageSso = true };
|
||||
yield return new Permissions { ManageUsers = true };
|
||||
yield return new Permissions { ManageResetPassword = true };
|
||||
yield return new Permissions { ManageScim = true };
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user