1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-02 00:22:50 -05:00

cipher delete for admin

This commit is contained in:
Kyle Spearrin
2017-04-19 16:00:47 -04:00
parent 552b117821
commit a9b0748d07
3 changed files with 18 additions and 3 deletions

View File

@ -65,9 +65,9 @@ namespace Bit.Core.Services
}
}
public async Task DeleteAsync(CipherDetails cipher, Guid deletingUserId)
public async Task DeleteAsync(Cipher cipher, Guid deletingUserId, bool orgAdmin = false)
{
if(!(await UserCanEditAsync(cipher, deletingUserId)))
if(!orgAdmin && !(await UserCanEditAsync(cipher, deletingUserId)))
{
throw new BadRequestException("Not an admin.");
}