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:
parent
6cb00ebc8e
commit
465549b812
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user