refactor(core): Setup decorator based RBAC (no-changelog) (#5787)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-04-24 09:45:31 +00:00
committed by GitHub
parent feb2ba09b9
commit 1eeadc6114
23 changed files with 133 additions and 165 deletions

View File

@@ -2,7 +2,7 @@ import type { Request } from 'express';
import { ICredentialTypes } from 'n8n-workflow';
import { join } from 'path';
import { access } from 'fs/promises';
import { Get, RestController } from '@/decorators';
import { Authorized, Get, RestController } from '@/decorators';
import { BadRequestError, InternalServerError } from '@/ResponseHelper';
import { Config } from '@/config';
import { NODES_BASE_DIR } from '@/constants';
@@ -14,6 +14,7 @@ export declare namespace TranslationRequest {
export type Credential = Request<{}, {}, {}, { credentialType: string }>;
}
@Authorized()
@RestController('/')
export class TranslationController {
constructor(private config: Config, private credentialTypes: ICredentialTypes) {}