feat: Allow instance owners and admins to edit all credentials (#8716)

Co-authored-by: Danny Martini <despair.blue@gmail.com>
This commit is contained in:
Omar Ajoue
2024-02-27 08:26:36 +00:00
committed by GitHub
parent 27f3166272
commit 737170893d
6 changed files with 26 additions and 14 deletions

View File

@@ -74,7 +74,9 @@ export class CredentialsController {
credential = this.ownershipService.addOwnedByAndSharedWith(credential);
if (!includeDecryptedData || !userSharing || userSharing.role !== 'credential:owner') {
// Below, if `userSharing` does not exist, it means this credential is being
// fetched by the instance owner or an admin. In this case, they get the full data
if (!includeDecryptedData || userSharing?.role === 'credential:user') {
const { data: _, ...rest } = credential;
return { ...rest };
}