mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
[AC-1389] [AC-1919] Only require CanManage permission when admins cannot access all items (#3530)
* move this error behind the Flexible Collections v1 flag instead of MVP * only enforce this requirement if organization.allowAdminAccessToAllCollectionItems is false --------- Co-authored-by: Thomas Rittson <trittson@bitwarden.com> Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
This commit is contained in:
@ -114,8 +114,9 @@ public class CollectionServiceTest
|
||||
collection.Id = default;
|
||||
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organization.Id).Returns(organization);
|
||||
sutProvider.GetDependency<IFeatureService>()
|
||||
.IsEnabled(FeatureFlagKeys.FlexibleCollections, Arg.Any<ICurrentContext>(), Arg.Any<bool>())
|
||||
.IsEnabled(FeatureFlagKeys.FlexibleCollectionsV1, Arg.Any<ICurrentContext>(), Arg.Any<bool>())
|
||||
.Returns(true);
|
||||
organization.AllowAdminAccessToAllCollectionItems = false;
|
||||
|
||||
var ex = await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.SaveAsync(collection, null, users));
|
||||
Assert.Contains("At least one member or group must have can manage permission.", ex.Message);
|
||||
|
Reference in New Issue
Block a user