Enhance newsletter management by adding role-based access control for group creation. Introduce computed property to determine if the user can create groups based on their roles, improving functionality and user experience.

This commit is contained in:
Torsten Schulz (local)
2025-12-19 10:03:21 +01:00
parent ccef4a33fb
commit c66a7a62cf

View File

@@ -608,10 +608,12 @@
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ref, computed, onMounted } from 'vue'
import { Plus, Loader2, Users, Trash2 } from 'lucide-vue-next'
import RichTextEditor from '~/components/RichTextEditor.vue'
const authStore = useAuthStore()
useHead({
title: 'Newsletter-Verwaltung - CMS - Harheimer TC',
})
@@ -639,6 +641,10 @@ const isAddingSubscriber = ref(false)
const addSubscriberError = ref('')
const addSubscriberSuccess = ref('')
const canCreateGroup = computed(() => {
return authStore.hasAnyRole('admin', 'vorstand', 'newsletter')
})
const groupFormData = ref({
name: '',
description: '',