1
0
mirror of https://github.com/bitwarden/server synced 2025-12-27 05:33:17 +00:00

[AC-1782] Import can manage (#3453)

* Changed Import permissions validation to check if the user CanCreate a Collection

* Corrected authorized to import validation allowing import without collections when the user is admin

* Added validation to check if user can import ciphers into existing collections

* swapped feature flag flexible collections with org property

* Removed unused feature service from ImportCiphersController

* Improved code readability

* added null protection against empty org when checking for FlexibleCollections flag
This commit is contained in:
aj-rosado
2024-01-29 14:46:34 +00:00
committed by GitHub
parent 114b72d738
commit c2b4ee7eac
3 changed files with 61 additions and 4 deletions

View File

@@ -76,6 +76,7 @@ public class BulkCollectionAuthorizationHandler : BulkAuthorizationHandler<BulkC
case not null when requirement == BulkCollectionOperations.Update:
case not null when requirement == BulkCollectionOperations.ModifyAccess:
case not null when requirement == BulkCollectionOperations.ImportCiphers:
await CanUpdateCollectionAsync(context, requirement, resources, org);
break;

View File

@@ -18,4 +18,5 @@ public static class BulkCollectionOperations
/// </summary>
public static readonly BulkCollectionOperationRequirement ModifyAccess = new() { Name = nameof(ModifyAccess) };
public static readonly BulkCollectionOperationRequirement Delete = new() { Name = nameof(Delete) };
public static readonly BulkCollectionOperationRequirement ImportCiphers = new() { Name = nameof(ImportCiphers) };
}