mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
remove subworkflow license check
This commit is contained in:
parent
48294e7ec1
commit
49c6942e6b
|
@ -107,24 +107,6 @@ describe('SubworkflowPolicyChecker', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('`any` caller policy', () => {
|
describe('`any` caller policy', () => {
|
||||||
it('if no sharing, should be overriden to `workflows-from-same-owner`', async () => {
|
|
||||||
license.isSharingEnabled.mockReturnValueOnce(false);
|
|
||||||
|
|
||||||
const parentWorkflow = mock<WorkflowEntity>();
|
|
||||||
const subworkflowId = 'subworkflow-id';
|
|
||||||
const subworkflow = mock<Workflow>({ id: subworkflowId, settings: { callerPolicy: 'any' } }); // should be overridden
|
|
||||||
|
|
||||||
const parentWorkflowProject = mock<Project>({ id: uuid() });
|
|
||||||
const subworkflowProject = mock<Project>({ id: uuid(), type: 'team' });
|
|
||||||
|
|
||||||
ownershipService.getWorkflowProjectCached.mockResolvedValueOnce(parentWorkflowProject);
|
|
||||||
ownershipService.getWorkflowProjectCached.mockResolvedValueOnce(subworkflowProject);
|
|
||||||
|
|
||||||
const check = checker.check(subworkflow, parentWorkflow.id);
|
|
||||||
|
|
||||||
await expect(check).rejects.toThrowError(SubworkflowPolicyDenialError);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should not throw on a regular subworkflow call', async () => {
|
it('should not throw on a regular subworkflow call', async () => {
|
||||||
const parentWorkflow = mock<WorkflowEntity>({ id: uuid() });
|
const parentWorkflow = mock<WorkflowEntity>({ id: uuid() });
|
||||||
const subworkflow = mock<Workflow>({ settings: { callerPolicy: 'any' } });
|
const subworkflow = mock<Workflow>({ settings: { callerPolicy: 'any' } });
|
||||||
|
|
|
@ -82,10 +82,8 @@ export class SubworkflowPolicyChecker {
|
||||||
* Find the subworkflow's caller policy.
|
* Find the subworkflow's caller policy.
|
||||||
*/
|
*/
|
||||||
private findPolicy(subworkflow: Workflow): WorkflowSettings.CallerPolicy {
|
private findPolicy(subworkflow: Workflow): WorkflowSettings.CallerPolicy {
|
||||||
if (!this.license.isSharingEnabled()) return 'workflowsFromSameOwner';
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
subworkflow.settings?.callerPolicy ?? this.globalConfig.workflows.callerPolicyDefaultOption
|
subworkflow.settings.callerPolicy ?? this.globalConfig.workflows.callerPolicyDefaultOption
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue