n8n/packages/cli/test/integration/shared/db/roles.ts
Tomi Turtiainen 9a1cc56806
fix: Set '@typescript-eslint/return-await' rule to 'always' for node code (no-changelog) (#8363)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
2024-01-17 17:08:50 +02:00

36 lines
956 B
TypeScript

import Container from 'typedi';
import { RoleService } from '@/services/role.service';
export async function getGlobalOwnerRole() {
return await Container.get(RoleService).findGlobalOwnerRole();
}
export async function getGlobalMemberRole() {
return await Container.get(RoleService).findGlobalMemberRole();
}
export async function getGlobalAdminRole() {
return await Container.get(RoleService).findGlobalAdminRole();
}
export async function getWorkflowOwnerRole() {
return await Container.get(RoleService).findWorkflowOwnerRole();
}
export async function getWorkflowEditorRole() {
return await Container.get(RoleService).findWorkflowEditorRole();
}
export async function getCredentialOwnerRole() {
return await Container.get(RoleService).findCredentialOwnerRole();
}
export async function getAllRoles() {
return await Promise.all([
getGlobalOwnerRole(),
getGlobalMemberRole(),
getWorkflowOwnerRole(),
getCredentialOwnerRole(),
]);
}