mirror of
https://github.com/bitwarden/server.git
synced 2024-12-25 17:27:45 +01:00
more user friendly error message for no access.
This commit is contained in:
parent
8f6406501c
commit
aa5b79df2b
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user