1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-27 03:41:30 +01:00

PM-17954 changing import permissions around based on requirements (#5385)

Co-authored-by: Daniel James Smith <2670567+djsmith85@users.noreply.github.com>
This commit is contained in:
Graham Walker 2025-02-13 12:43:34 -06:00 committed by GitHub
parent 6cb00ebc8e
commit 465549b812
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -96,12 +96,6 @@ public class ImportCiphersController : Controller
return true;
}
//Users allowed to import if they CanCreate Collections
if (!(await _authorizationService.AuthorizeAsync(User, collections, BulkCollectionOperations.Create)).Succeeded)
{
return false;
}
//Calling Repository instead of Service as we want to get all the collections, regardless of permission
//Permissions check will be done later on AuthorizationService
var orgCollectionIds =
@ -118,6 +112,12 @@ public class ImportCiphersController : Controller
return false;
};
//Users allowed to import if they CanCreate Collections
if (!(await _authorizationService.AuthorizeAsync(User, collections, BulkCollectionOperations.Create)).Succeeded)
{
return false;
}
return true;
}
}