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