mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(core): Rebuild project roles to load from the database (#17909)
This commit is contained in:
committed by
GitHub
parent
ab7998b441
commit
f757790394
@@ -13,13 +13,9 @@ import {
|
||||
UserRepository,
|
||||
} from '@n8n/db';
|
||||
import { Container } from '@n8n/di';
|
||||
import { PROJECT_OWNER_ROLE_SLUG } from '@n8n/permissions';
|
||||
import { Not } from '@n8n/typeorm';
|
||||
|
||||
import { EventService } from '@/events/event.service';
|
||||
import { ExternalHooks } from '@/external-hooks';
|
||||
import { PasswordUtility } from '@/services/password.utility';
|
||||
import { UserManagementMailer } from '@/user-management/email';
|
||||
|
||||
import {
|
||||
assertReturnedUserProps,
|
||||
assertStoredUserProps,
|
||||
@@ -29,6 +25,11 @@ import { createMember, createOwner, createUserShell } from '../../shared/db/user
|
||||
import * as utils from '../../shared/utils';
|
||||
import type { UserInvitationResult } from '../../shared/utils/users';
|
||||
|
||||
import { EventService } from '@/events/event.service';
|
||||
import { ExternalHooks } from '@/external-hooks';
|
||||
import { PasswordUtility } from '@/services/password.utility';
|
||||
import { UserManagementMailer } from '@/user-management/email';
|
||||
|
||||
describe('InvitationController', () => {
|
||||
const mailer = mockInstance(UserManagementMailer);
|
||||
const externalHooks = mockInstance(ExternalHooks);
|
||||
@@ -296,7 +297,7 @@ describe('InvitationController', () => {
|
||||
const projectRelation = await projectRelationRepository.findOneOrFail({
|
||||
where: {
|
||||
userId: storedUser.id,
|
||||
role: 'project:personalOwner',
|
||||
role: { slug: PROJECT_OWNER_ROLE_SLUG },
|
||||
project: {
|
||||
type: 'personal',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user