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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user