mirror of
https://github.com/bitwarden/server.git
synced 2025-01-23 22:01:28 +01:00
6a9b7ece2b
- also fix managed collections export from CLI
39 lines
957 B
C#
39 lines
957 B
C#
using Bit.Core.Models.Data;
|
|
using Xunit;
|
|
|
|
namespace Bit.Core.Test.AdminConsole.Helpers;
|
|
|
|
public class AuthorizationHelpersTests
|
|
{
|
|
[Fact]
|
|
public void Permissions_Invert_InvertsAllPermissions()
|
|
{
|
|
var sut = new Permissions
|
|
{
|
|
AccessEventLogs = true,
|
|
AccessReports = true,
|
|
DeleteAnyCollection = true,
|
|
ManagePolicies = true,
|
|
ManageScim = true
|
|
};
|
|
|
|
var result = sut.Invert();
|
|
|
|
Assert.True(result is
|
|
{
|
|
AccessEventLogs: false,
|
|
AccessImportExport: true,
|
|
AccessReports: false,
|
|
CreateNewCollections: true,
|
|
EditAnyCollection: true,
|
|
DeleteAnyCollection: false,
|
|
ManageGroups: true,
|
|
ManagePolicies: false,
|
|
ManageSso: true,
|
|
ManageUsers: true,
|
|
ManageResetPassword: true,
|
|
ManageScim: false
|
|
});
|
|
}
|
|
}
|