mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
more user friendly error message for no access.
This commit is contained in:
@ -44,7 +44,7 @@ namespace Bit.Core.Services
|
|||||||
{
|
{
|
||||||
if(!(await UserCanEditAsync(cipher, savingUserId)))
|
if(!(await UserCanEditAsync(cipher, savingUserId)))
|
||||||
{
|
{
|
||||||
throw new BadRequestException("Not an admin.");
|
throw new BadRequestException("You do not have permissions to edit this.");
|
||||||
}
|
}
|
||||||
|
|
||||||
cipher.UserId = savingUserId;
|
cipher.UserId = savingUserId;
|
||||||
@ -69,7 +69,7 @@ namespace Bit.Core.Services
|
|||||||
{
|
{
|
||||||
if(!orgAdmin && !(await UserCanEditAsync(cipher, deletingUserId)))
|
if(!orgAdmin && !(await UserCanEditAsync(cipher, deletingUserId)))
|
||||||
{
|
{
|
||||||
throw new BadRequestException("Not an admin.");
|
throw new BadRequestException("You do not have permissions to delete this.");
|
||||||
}
|
}
|
||||||
|
|
||||||
await _cipherRepository.DeleteAsync(cipher);
|
await _cipherRepository.DeleteAsync(cipher);
|
||||||
|
Reference in New Issue
Block a user