mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Move more code into @n8n/permissions. Add aditional tests and docs (no-changelog) (#15062)
Co-authored-by: Danny Martini <danny@n8n.io>
This commit is contained in:
committed by
GitHub
parent
cdcd059248
commit
2bb190349b
@@ -1,10 +1,10 @@
|
||||
import type { Project } from '@n8n/db';
|
||||
import type { CredentialSharingRole } from '@n8n/db';
|
||||
import type { User } from '@n8n/db';
|
||||
import type { ICredentialsDb } from '@n8n/db';
|
||||
import { CredentialsEntity } from '@n8n/db';
|
||||
import { CredentialsRepository } from '@n8n/db';
|
||||
import { Container } from '@n8n/di';
|
||||
import type { CredentialSharingRole } from '@n8n/permissions';
|
||||
|
||||
import { ProjectRepository } from '@/databases/repositories/project.repository';
|
||||
import { SharedCredentialsRepository } from '@/databases/repositories/shared-credentials.repository';
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { ProjectRole } from '@n8n/api-types';
|
||||
import type { Project } from '@n8n/db';
|
||||
import type { User } from '@n8n/db';
|
||||
import type { ProjectRelation } from '@n8n/db';
|
||||
import { Container } from '@n8n/di';
|
||||
import type { ProjectRole } from '@n8n/permissions';
|
||||
|
||||
import { ProjectRelationRepository } from '@/databases/repositories/project-relation.repository';
|
||||
import { ProjectRepository } from '@/databases/repositories/project.repository';
|
||||
|
||||
@@ -39,7 +39,6 @@ export async function newUser(attributes: Partial<User> = {}): Promise<User> {
|
||||
export async function createUser(attributes: Partial<User> = {}): Promise<User> {
|
||||
const userInstance = await newUser(attributes);
|
||||
const { user } = await Container.get(UserRepository).createUserWithProject(userInstance);
|
||||
user.computeIsOwner();
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Project } from '@n8n/db';
|
||||
import { User } from '@n8n/db';
|
||||
import type { SharedWorkflow, WorkflowSharingRole } from '@n8n/db';
|
||||
import type { SharedWorkflow } from '@n8n/db';
|
||||
import type { IWorkflowDb } from '@n8n/db';
|
||||
import { Container } from '@n8n/di';
|
||||
import type { WorkflowSharingRole } from '@n8n/permissions';
|
||||
import type { DeepPartial } from '@n8n/typeorm';
|
||||
import type { IWorkflowBase } from 'n8n-workflow';
|
||||
import { NodeConnectionTypes } from 'n8n-workflow';
|
||||
|
||||
Reference in New Issue
Block a user