Füge Unterstützung für Kontaktanfragen hinzu, einschließlich neuer Routen und Berechtigungen für Trainer und Vorstand. Aktualisiere E-Mail-Versandlogik, um Anfragen an alle relevanten Empfänger weiterzuleiten.
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 56s
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 56s
This commit is contained in:
@@ -19,12 +19,17 @@ export default defineNuxtRouteMiddleware(async (to, _from) => {
|
||||
if (to.path.startsWith('/cms')) {
|
||||
const roles = auth.value.roles || (auth.value.role ? [auth.value.role] : [])
|
||||
const hasAccess = roles.includes('admin') || roles.includes('vorstand') || roles.includes('newsletter')
|
||||
const canAccessContactRequests = roles.includes('admin') || roles.includes('vorstand') || roles.includes('trainer')
|
||||
|
||||
// Newsletter-Seite nur für Newsletter-Rolle, Admin oder Vorstand
|
||||
if (to.path.startsWith('/cms/newsletter')) {
|
||||
if (!hasAccess) {
|
||||
return navigateTo('/mitgliederbereich')
|
||||
}
|
||||
} else if (to.path.startsWith('/cms/kontaktanfragen')) {
|
||||
if (!canAccessContactRequests) {
|
||||
return navigateTo('/mitgliederbereich')
|
||||
}
|
||||
} else {
|
||||
// Andere CMS-Seiten nur für Admin oder Vorstand
|
||||
const isAdmin = roles.includes('admin') || roles.includes('vorstand')
|
||||
|
||||
Reference in New Issue
Block a user