2023-11-08 07:29:39 -08:00
|
|
|
import Container from 'typedi';
|
|
|
|
import { RoleService } from '@/services/role.service';
|
|
|
|
|
|
|
|
export async function getGlobalOwnerRole() {
|
2024-01-17 07:08:50 -08:00
|
|
|
return await Container.get(RoleService).findGlobalOwnerRole();
|
2023-11-08 07:29:39 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function getGlobalMemberRole() {
|
2024-01-17 07:08:50 -08:00
|
|
|
return await Container.get(RoleService).findGlobalMemberRole();
|
2023-11-08 07:29:39 -08:00
|
|
|
}
|
|
|
|
|
2023-11-24 02:40:08 -08:00
|
|
|
export async function getGlobalAdminRole() {
|
2024-01-17 07:08:50 -08:00
|
|
|
return await Container.get(RoleService).findGlobalAdminRole();
|
2023-11-24 02:40:08 -08:00
|
|
|
}
|
|
|
|
|
2023-11-08 07:29:39 -08:00
|
|
|
export async function getWorkflowOwnerRole() {
|
2024-01-17 07:08:50 -08:00
|
|
|
return await Container.get(RoleService).findWorkflowOwnerRole();
|
2023-11-08 07:29:39 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function getWorkflowEditorRole() {
|
2024-01-17 07:08:50 -08:00
|
|
|
return await Container.get(RoleService).findWorkflowEditorRole();
|
2023-11-08 07:29:39 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function getCredentialOwnerRole() {
|
2024-01-17 07:08:50 -08:00
|
|
|
return await Container.get(RoleService).findCredentialOwnerRole();
|
2023-11-08 07:29:39 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function getAllRoles() {
|
2024-01-17 07:08:50 -08:00
|
|
|
return await Promise.all([
|
2023-11-08 07:29:39 -08:00
|
|
|
getGlobalOwnerRole(),
|
|
|
|
getGlobalMemberRole(),
|
|
|
|
getWorkflowOwnerRole(),
|
|
|
|
getCredentialOwnerRole(),
|
|
|
|
]);
|
|
|
|
}
|