Update dependencies to include TinyMCE and Quill, enhance Navigation component with a new Newsletter submenu, and implement role-based access control for CMS features. Refactor user role handling to support multiple roles and improve user management functionality across various API endpoints.
This commit is contained in:
@@ -3,7 +3,7 @@ import fs from 'fs/promises'
|
||||
import path from 'path'
|
||||
import { exec } from 'child_process'
|
||||
import { promisify } from 'util'
|
||||
import { getUserFromToken } from '../../utils/auth.js'
|
||||
import { getUserFromToken, hasAnyRole } from '../../utils/auth.js'
|
||||
|
||||
const execAsync = promisify(exec)
|
||||
|
||||
@@ -62,7 +62,7 @@ export default defineEventHandler(async (event) => {
|
||||
})
|
||||
}
|
||||
|
||||
if (currentUser.role !== 'admin' && currentUser.role !== 'vorstand') {
|
||||
if (!hasAnyRole(currentUser, 'admin', 'vorstand')) {
|
||||
throw createError({
|
||||
statusCode: 403,
|
||||
statusMessage: 'Keine Berechtigung'
|
||||
|
||||
Reference in New Issue
Block a user