refactor(core, editor): Remove legacy nodesAccess (no-changelog) (#9016)

This commit is contained in:
Iván Ovejero
2024-04-05 13:17:34 +02:00
committed by GitHub
parent ba986fb018
commit b8ab049932
39 changed files with 45 additions and 266 deletions

View File

@@ -6,19 +6,6 @@ import { Cipher } from './Cipher';
export class Credentials extends ICredentials {
private readonly cipher = Container.get(Cipher);
/**
* Returns if the given nodeType has access to data
*/
hasNodeAccess(nodeType: string): boolean {
for (const accessData of this.nodesAccess) {
if (accessData.nodeType === nodeType) {
return true;
}
}
return false;
}
/**
* Sets new credential object
*/
@@ -29,14 +16,7 @@ export class Credentials extends ICredentials {
/**
* Returns the decrypted credential object
*/
getData(nodeType?: string): ICredentialDataDecryptedObject {
if (nodeType && !this.hasNodeAccess(nodeType)) {
throw new ApplicationError('Node does not have access to credential', {
tags: { nodeType, credentialType: this.type },
extra: { credentialName: this.name },
});
}
getData(): ICredentialDataDecryptedObject {
if (this.data === undefined) {
throw new ApplicationError('No data is set so nothing can be returned.');
}
@@ -65,7 +45,6 @@ export class Credentials extends ICredentials {
name: this.name,
type: this.type,
data: this.data,
nodesAccess: this.nodesAccess,
};
}
}