mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Finish removing UserManagementHelper (no-changelog) (#8418)
This commit is contained in:
@@ -3,7 +3,7 @@ import { ExecutionRequest } from './execution.types';
|
||||
import { ExecutionService } from './execution.service';
|
||||
import { Authorized, Get, Post, RestController } from '@/decorators';
|
||||
import { EnterpriseExecutionsService } from './execution.service.ee';
|
||||
import { isSharingEnabled } from '@/UserManagement/UserManagementHelper';
|
||||
import { License } from '@/License';
|
||||
import { WorkflowSharingService } from '@/workflows/workflowSharing.service';
|
||||
import type { User } from '@/databases/entities/User';
|
||||
import config from '@/config';
|
||||
@@ -21,10 +21,11 @@ export class ExecutionsController {
|
||||
private readonly enterpriseExecutionService: EnterpriseExecutionsService,
|
||||
private readonly workflowSharingService: WorkflowSharingService,
|
||||
private readonly activeExecutionService: ActiveExecutionService,
|
||||
private readonly license: License,
|
||||
) {}
|
||||
|
||||
private async getAccessibleWorkflowIds(user: User) {
|
||||
return isSharingEnabled()
|
||||
return this.license.isSharingEnabled()
|
||||
? await this.workflowSharingService.getSharedWorkflowIds(user)
|
||||
: await this.workflowSharingService.getSharedWorkflowIds(user, ['owner']);
|
||||
}
|
||||
@@ -68,7 +69,7 @@ export class ExecutionsController {
|
||||
|
||||
if (workflowIds.length === 0) throw new NotFoundError('Execution not found');
|
||||
|
||||
return isSharingEnabled()
|
||||
return this.license.isSharingEnabled()
|
||||
? await this.enterpriseExecutionService.findOne(req, workflowIds)
|
||||
: await this.executionService.findOne(req, workflowIds);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user