Admin navigation permissions

This commit is contained in:
2025-12-01 23:57:26 -05:00
parent 9ac885da56
commit 9fe18f6b1a
5 changed files with 64 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
import pool from '../db';
import { Role } from '@app/shared/types/roles'
export async function assignUserGroup(userID: number, roleID: number) {
@@ -16,7 +17,7 @@ export async function createGroup(name: string, color: string, description: stri
return { id: result.insertId, name, color, description };
}
export async function getUserRoles(userID: number) {
export async function getUserRoles(userID: number): Promise<Role[]> {
const sql = `SELECT r.id, r.name
FROM members_roles mr
INNER JOIN roles r ON mr.role_id = r.id