Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AC-2447] Owner/Admin Can Remove Last Accessible Collection From Item #3992

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Api/Vault/Controllers/CiphersController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,11 @@
model.CollectionIds.Select(c => new Guid(c)), userId, false);

var updatedCipherCollections = await GetByIdAsync(id, userId);
// If user cannot access cipher after update return an error to client
if (updatedCipherCollections == null)
{
throw new NotFoundException();

Check warning on line 580 in src/Api/Vault/Controllers/CiphersController.cs

View check run for this annotation

Codecov / codecov/patch

src/Api/Vault/Controllers/CiphersController.cs#L579-L580

Added lines #L579 - L580 were not covered by tests
}
var response = new CipherResponseModel(updatedCipherCollections, _globalSettings);
return response;
}
Expand Down