mirror of
https://github.com/bitwarden/server.git
synced 2024-11-21 12:05:42 +01:00
[AC-1139] Removed unnecessary permissions object creation on unit tests
This commit is contained in:
parent
e7dc0a4b8a
commit
b20d75b232
@ -32,7 +32,6 @@ public class BulkCollectionAuthorizationHandlerTests
|
||||
{
|
||||
organization.Type = userType;
|
||||
organization.LimitCollectionCreationDeletion = true;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
var context = new AuthorizationHandlerContext(
|
||||
new[] { BulkCollectionOperations.Create },
|
||||
@ -142,7 +141,6 @@ public class BulkCollectionAuthorizationHandlerTests
|
||||
{
|
||||
organization.Type = userType;
|
||||
organization.LimitCollectionCreationDeletion = true;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
sutProvider.GetDependency<ICurrentContext>().UserId.Returns(userId);
|
||||
sutProvider.GetDependency<ICurrentContext>().GetOrganization(organization.Id).Returns(organization);
|
||||
@ -204,7 +202,6 @@ public class BulkCollectionAuthorizationHandlerTests
|
||||
|
||||
organization.Type = OrganizationUserType.User;
|
||||
organization.LimitCollectionCreationDeletion = false;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
sutProvider.GetDependency<ICurrentContext>().UserId.Returns(actingUserId);
|
||||
sutProvider.GetDependency<ICurrentContext>().GetOrganization(organization.Id).Returns(organization);
|
||||
@ -287,7 +284,6 @@ public class BulkCollectionAuthorizationHandlerTests
|
||||
{
|
||||
organization.Type = userType;
|
||||
organization.LimitCollectionCreationDeletion = true;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
sutProvider.GetDependency<ICurrentContext>().UserId.Returns(userId);
|
||||
sutProvider.GetDependency<ICurrentContext>().GetOrganization(organization.Id).Returns(organization);
|
||||
@ -349,7 +345,6 @@ public class BulkCollectionAuthorizationHandlerTests
|
||||
|
||||
organization.Type = OrganizationUserType.User;
|
||||
organization.LimitCollectionCreationDeletion = false;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
sutProvider.GetDependency<ICurrentContext>().UserId.Returns(actingUserId);
|
||||
sutProvider.GetDependency<ICurrentContext>().GetOrganization(organization.Id).Returns(organization);
|
||||
@ -430,7 +425,6 @@ public class BulkCollectionAuthorizationHandlerTests
|
||||
{
|
||||
organization.Type = userType;
|
||||
organization.LimitCollectionCreationDeletion = true;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
var operationsToTest = new[]
|
||||
{
|
||||
@ -503,7 +497,6 @@ public class BulkCollectionAuthorizationHandlerTests
|
||||
var actingUserId = Guid.NewGuid();
|
||||
|
||||
organization.Type = OrganizationUserType.User;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
foreach (var c in collections)
|
||||
{
|
||||
@ -629,7 +622,6 @@ public class BulkCollectionAuthorizationHandlerTests
|
||||
{
|
||||
organization.Type = userType;
|
||||
organization.LimitCollectionCreationDeletion = true;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
var context = new AuthorizationHandlerContext(
|
||||
new[] { BulkCollectionOperations.Delete },
|
||||
@ -681,7 +673,6 @@ public class BulkCollectionAuthorizationHandlerTests
|
||||
var actingUserId = Guid.NewGuid();
|
||||
|
||||
organization.Type = OrganizationUserType.User;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
sutProvider.GetDependency<ICurrentContext>().UserId.Returns(actingUserId);
|
||||
sutProvider.GetDependency<ICurrentContext>().GetOrganization(organization.Id).Returns(organization);
|
||||
|
@ -26,7 +26,6 @@ public class CollectionAuthorizationHandlerTests
|
||||
CurrentContextOrganization organization)
|
||||
{
|
||||
organization.Type = userType;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
var context = new AuthorizationHandlerContext(
|
||||
new[] { CollectionOperations.ReadAll(organization.Id) },
|
||||
@ -47,7 +46,6 @@ public class CollectionAuthorizationHandlerTests
|
||||
SutProvider<CollectionAuthorizationHandler> sutProvider, CurrentContextOrganization organization)
|
||||
{
|
||||
organization.Type = OrganizationUserType.User;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
var context = new AuthorizationHandlerContext(
|
||||
new[] { CollectionOperations.ReadAll(organization.Id) },
|
||||
@ -138,7 +136,6 @@ public class CollectionAuthorizationHandlerTests
|
||||
CurrentContextOrganization organization)
|
||||
{
|
||||
organization.Type = userType;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
var context = new AuthorizationHandlerContext(
|
||||
new[] { CollectionOperations.ReadAllWithAccess(organization.Id) },
|
||||
@ -159,7 +156,6 @@ public class CollectionAuthorizationHandlerTests
|
||||
SutProvider<CollectionAuthorizationHandler> sutProvider, CurrentContextOrganization organization)
|
||||
{
|
||||
organization.Type = OrganizationUserType.User;
|
||||
organization.Permissions = new Permissions();
|
||||
|
||||
var context = new AuthorizationHandlerContext(
|
||||
new[] { CollectionOperations.ReadAllWithAccess(organization.Id) },
|
||||
|
Loading…
Reference in New Issue
Block a user