@ -1,6 +1,5 @@
using System.Security.Claims ;
using Bit.Api.Vault.AuthorizationHandlers.Collections ;
using Bit.Core ;
using Bit.Core.Context ;
using Bit.Core.Entities ;
using Bit.Core.Enums ;
@ -561,7 +560,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < IApplicationCacheService > ( ) . GetOrganizationAbilityAsync ( organization . Id )
. Returns ( organizationAbility ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 ) . Returns ( true ) ;
var context = new AuthorizationHandlerContext (
new [ ] { op } ,
@ -604,7 +602,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < IApplicationCacheService > ( ) . GetOrganizationAbilityAsync ( organization . Id )
. Returns ( organizationAbility ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 ) . Returns ( true ) ;
var context = new AuthorizationHandlerContext (
new [ ] { op } ,
@ -802,8 +799,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . UserId . Returns ( actingUserId ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 )
. Returns ( true ) ;
sutProvider . GetDependency < IApplicationCacheService > ( ) . GetOrganizationAbilityAsync ( organization . Id )
. Returns ( new OrganizationAbility { AllowAdminAccessToAllCollectionItems = true } ) ;
@ -830,8 +825,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . UserId . Returns ( actingUserId ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 )
. Returns ( true ) ;
sutProvider . GetDependency < IApplicationCacheService > ( ) . GetOrganizationAbilityAsync ( organization . Id )
. Returns ( new OrganizationAbility { AllowAdminAccessToAllCollectionItems = false } ) ;
@ -858,8 +851,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . UserId . Returns ( actingUserId ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 )
. Returns ( true ) ;
sutProvider . GetDependency < IApplicationCacheService > ( ) . GetOrganizationAbilityAsync ( organization . Id )
. Returns ( new OrganizationAbility { AllowAdminAccessToAllCollectionItems = true } ) ;
@ -886,8 +877,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . UserId . Returns ( actingUserId ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 )
. Returns ( true ) ;
sutProvider . GetDependency < IApplicationCacheService > ( ) . GetOrganizationAbilityAsync ( organization . Id )
. Returns ( new OrganizationAbility { AllowAdminAccessToAllCollectionItems = false } ) ;
@ -1009,7 +998,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . UserId . Returns ( actingUserId ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < ICollectionRepository > ( ) . GetManyByUserIdAsync ( actingUserId ) . Returns ( collections ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 ) . Returns ( true ) ;
foreach ( var c in collections )
{
@ -1045,7 +1033,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . UserId . Returns ( actingUserId ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < ICollectionRepository > ( ) . GetManyByUserIdAsync ( actingUserId ) . Returns ( collections ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 ) . Returns ( true ) ;
foreach ( var c in collections )
{
@ -1081,7 +1068,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . UserId . Returns ( actingUserId ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < ICollectionRepository > ( ) . GetManyByUserIdAsync ( actingUserId ) . Returns ( collections ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 ) . Returns ( true ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . ProviderUserForOrgAsync ( Arg . Any < Guid > ( ) ) . Returns ( false ) ;
foreach ( var c in collections )
@ -1115,7 +1101,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . UserId . Returns ( actingUserId ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < ICollectionRepository > ( ) . GetManyByUserIdAsync ( actingUserId ) . Returns ( collections ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 ) . Returns ( true ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . ProviderUserForOrgAsync ( Arg . Any < Guid > ( ) ) . Returns ( false ) ;
foreach ( var c in collections )
@ -1149,7 +1134,6 @@ public class BulkCollectionAuthorizationHandlerTests
sutProvider . GetDependency < ICurrentContext > ( ) . UserId . Returns ( actingUserId ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . GetOrganization ( organization . Id ) . Returns ( organization ) ;
sutProvider . GetDependency < ICollectionRepository > ( ) . GetManyByUserIdAsync ( actingUserId ) . Returns ( collections ) ;
sutProvider . GetDependency < IFeatureService > ( ) . IsEnabled ( FeatureFlagKeys . FlexibleCollectionsV1 ) . Returns ( true ) ;
sutProvider . GetDependency < ICurrentContext > ( ) . ProviderUserForOrgAsync ( Arg . Any < Guid > ( ) ) . Returns ( false ) ;
foreach ( var c in collections )