mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -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', () => {
|
||||
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 () => {
|
||||
const parentWorkflow = mock<WorkflowEntity>({ id: uuid() });
|
||||
const subworkflow = mock<Workflow>({ settings: { callerPolicy: 'any' } });
|
||||
|
|
|
@ -82,10 +82,8 @@ export class SubworkflowPolicyChecker {
|
|||
* Find the subworkflow's caller policy.
|
||||
*/
|
||||
private findPolicy(subworkflow: Workflow): WorkflowSettings.CallerPolicy {
|
||||
if (!this.license.isSharingEnabled()) return 'workflowsFromSameOwner';
|
||||
|
||||
return (
|
||||
subworkflow.settings?.callerPolicy ?? this.globalConfig.workflows.callerPolicyDefaultOption
|
||||
subworkflow.settings.callerPolicy ?? this.globalConfig.workflows.callerPolicyDefaultOption
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue