mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat(core): Allow custom project roles from being set to a user project relation (#18926)
This commit is contained in:
committed by
GitHub
parent
5b5f60212a
commit
027edbe89d
@@ -9,13 +9,11 @@ import {
|
||||
testDb,
|
||||
mockInstance,
|
||||
} from '@n8n/backend-test-utils';
|
||||
import type { Project, ProjectRole, User } from '@n8n/db';
|
||||
import type { Project, User } from '@n8n/db';
|
||||
import { FolderRepository, ProjectRepository, WorkflowRepository } from '@n8n/db';
|
||||
import { Container } from '@n8n/di';
|
||||
import { DateTime } from 'luxon';
|
||||
import { ApplicationError, PROJECT_ROOT } from 'n8n-workflow';
|
||||
|
||||
import { ActiveWorkflowManager } from '@/active-workflow-manager';
|
||||
import type { ProjectRole } from '@n8n/permissions';
|
||||
import { PROJECT_EDITOR_ROLE_SLUG, PROJECT_VIEWER_ROLE_SLUG } from '@n8n/permissions';
|
||||
import {
|
||||
createCredentials,
|
||||
getCredentialSharings,
|
||||
@@ -25,11 +23,15 @@ import {
|
||||
} from '@test-integration/db/credentials';
|
||||
import { createFolder } from '@test-integration/db/folders';
|
||||
import { createTag } from '@test-integration/db/tags';
|
||||
import { DateTime } from 'luxon';
|
||||
import { ApplicationError, PROJECT_ROOT } from 'n8n-workflow';
|
||||
|
||||
import { createOwner, createMember, createUser, createAdmin } from '../shared/db/users';
|
||||
import type { SuperAgentTest } from '../shared/types';
|
||||
import * as utils from '../shared/utils/';
|
||||
|
||||
import { ActiveWorkflowManager } from '@/active-workflow-manager';
|
||||
|
||||
let owner: User;
|
||||
let member: User;
|
||||
let authOwnerAgent: SuperAgentTest;
|
||||
@@ -1863,7 +1865,7 @@ describe('PUT /projects/:projectId/folders/:folderId/transfer', () => {
|
||||
.expect(404);
|
||||
});
|
||||
|
||||
test.each<ProjectRole>(['project:editor', 'project:viewer'])(
|
||||
test.each<ProjectRole>([PROJECT_EDITOR_ROLE_SLUG, PROJECT_VIEWER_ROLE_SLUG])(
|
||||
'%ss cannot transfer workflows',
|
||||
async (projectRole) => {
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user