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:
@@ -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: '',
|
||||
|
||||
Reference in New Issue
Block a user