mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
make sure user has access to cipher
This commit is contained in:
@ -54,7 +54,7 @@ namespace Bit.Api.Controllers
|
||||
{
|
||||
var userId = _userService.GetProperUserId(User).Value;
|
||||
var cipher = await _cipherRepository.GetByIdAsync(new Guid(id), userId);
|
||||
if(cipher == null ||
|
||||
if(cipher == null || (cipher.UserId.HasValue && userId != cipher.UserId) ||
|
||||
(cipher.OrganizationId.HasValue && !_currentContext.OrganizationAdmin(cipher.OrganizationId.Value)))
|
||||
{
|
||||
throw new NotFoundException();
|
||||
|
Reference in New Issue
Block a user