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:
@@ -39,7 +39,8 @@ export default defineEventHandler(async (event) => {
|
||||
if (token) {
|
||||
// Authentifizierte Benutzer prüfen
|
||||
const user = await getUserFromToken(token)
|
||||
if (user && ['admin', 'vorstand'].includes(user.role)) {
|
||||
const roles = Array.isArray(user.roles) ? user.roles : (user.role ? [user.role] : [])
|
||||
if (user && (roles.includes('admin') || roles.includes('vorstand'))) {
|
||||
// Admin/Vorstand kann alle Dateien herunterladen
|
||||
isAuthorized = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user