fix(core): Allow owner and admin to edit nodes with credentials that haven't been shared with them explicitly (#9922)
This commit is contained in:
@@ -63,11 +63,10 @@ export class CredentialsService {
|
||||
user: User,
|
||||
options: {
|
||||
listQueryOptions?: ListQuery.Options;
|
||||
onlyOwn?: boolean;
|
||||
includeScopes?: string;
|
||||
} = {},
|
||||
) {
|
||||
const returnAll = user.hasGlobalScope('credential:list') && !options.onlyOwn;
|
||||
const returnAll = user.hasGlobalScope('credential:list');
|
||||
const isDefaultSelect = !options.listQueryOptions?.select;
|
||||
|
||||
let projectRelations: ProjectRelation[] | undefined = undefined;
|
||||
|
||||
@@ -80,7 +80,10 @@ export class EnterpriseWorkflowService {
|
||||
currentUser: User,
|
||||
): Promise<void> {
|
||||
workflow.usedCredentials = [];
|
||||
const userCredentials = await this.credentialsService.getMany(currentUser, { onlyOwn: true });
|
||||
const userCredentials = await this.credentialsService.getCredentialsAUserCanUseInAWorkflow(
|
||||
currentUser,
|
||||
{ workflowId: workflow.id },
|
||||
);
|
||||
const credentialIdsUsedByWorkflow = new Set<string>();
|
||||
workflow.nodes.forEach((node) => {
|
||||
if (!node.credentials) {
|
||||
|
||||
Reference in New Issue
Block a user