mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +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,7 +1,6 @@
|
||||
import type { ProjectRole } from '@n8n/api-types';
|
||||
import type { Project } from '@n8n/db';
|
||||
import { Container } from '@n8n/di';
|
||||
import type { GlobalRole, Scope } from '@n8n/permissions';
|
||||
import { getRoleScopes, type GlobalRole, type ProjectRole, type Scope } from '@n8n/permissions';
|
||||
import { EntityNotFoundError } from '@n8n/typeorm';
|
||||
|
||||
import { ActiveWorkflowManager } from '@/active-workflow-manager';
|
||||
@@ -12,7 +11,6 @@ import { SharedCredentialsRepository } from '@/databases/repositories/shared-cre
|
||||
import { SharedWorkflowRepository } from '@/databases/repositories/shared-workflow.repository';
|
||||
import { getWorkflowById } from '@/public-api/v1/handlers/workflows/workflows.service';
|
||||
import { CacheService } from '@/services/cache/cache.service';
|
||||
import { RoleService } from '@/services/role.service';
|
||||
import { createFolder } from '@test-integration/db/folders';
|
||||
|
||||
import {
|
||||
@@ -391,7 +389,7 @@ describe('POST /projects/', () => {
|
||||
await findProject(respProject.id);
|
||||
}).not.toThrow();
|
||||
expect(resp.body.data.role).toBe('project:admin');
|
||||
for (const scope of Container.get(RoleService).getRoleScopes('project:admin')) {
|
||||
for (const scope of getRoleScopes('project:admin')) {
|
||||
expect(resp.body.data.scopes).toContain(scope);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user