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:
@@ -51,6 +51,7 @@
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Name</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">E-Mail</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Telefon</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Mannschaft</th>
|
||||
<th class="px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Status</th>
|
||||
<th v-if="canEdit" class="px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Aktionen</th>
|
||||
</tr>
|
||||
@@ -79,6 +80,15 @@
|
||||
</template>
|
||||
<span v-else class="text-sm text-gray-400">Nur für Vorstand</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 whitespace-nowrap">
|
||||
<span
|
||||
v-if="member.isMannschaftsspieler"
|
||||
class="px-2 py-1 bg-blue-100 text-blue-800 text-xs font-medium rounded-full"
|
||||
>
|
||||
Ja
|
||||
</span>
|
||||
<span v-else class="text-sm text-gray-400">-</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 whitespace-nowrap">
|
||||
<div class="flex items-center space-x-2">
|
||||
<span
|
||||
@@ -153,6 +163,12 @@
|
||||
>
|
||||
Aus Login-System
|
||||
</span>
|
||||
<span
|
||||
v-if="member.isMannschaftsspieler"
|
||||
class="ml-2 px-2 py-1 bg-blue-100 text-blue-800 text-xs font-medium rounded-full"
|
||||
>
|
||||
Mannschaftsspieler
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="grid sm:grid-cols-2 gap-3 text-gray-600">
|
||||
@@ -296,6 +312,19 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center">
|
||||
<input
|
||||
v-model="formData.isMannschaftsspieler"
|
||||
type="checkbox"
|
||||
id="isMannschaftsspieler"
|
||||
class="h-4 w-4 text-primary-600 focus:ring-primary-500 border-gray-300 rounded"
|
||||
:disabled="isSaving"
|
||||
/>
|
||||
<label for="isMannschaftsspieler" class="ml-2 block text-sm font-medium text-gray-700">
|
||||
Mannschaftsspieler
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div v-if="errorMessage" class="flex items-center p-3 rounded-md bg-red-50 text-red-700 text-sm">
|
||||
<AlertCircle :size="20" class="mr-2" />
|
||||
{{ errorMessage }}
|
||||
@@ -494,18 +523,17 @@ const formData = ref({
|
||||
email: '',
|
||||
phone: '',
|
||||
address: '',
|
||||
notes: ''
|
||||
notes: '',
|
||||
isMannschaftsspieler: false
|
||||
})
|
||||
|
||||
const canEdit = computed(() => {
|
||||
return authStore.role === 'admin' || authStore.role === 'vorstand'
|
||||
return authStore.hasAnyRole('admin', 'vorstand')
|
||||
})
|
||||
|
||||
const canViewContactData = computed(() => {
|
||||
// Explicitly check for 'vorstand' role only
|
||||
const role = authStore.role
|
||||
console.log('Current role:', role, 'Can view contact:', role === 'vorstand')
|
||||
return role === 'vorstand'
|
||||
return authStore.hasRole('vorstand')
|
||||
})
|
||||
|
||||
const loadMembers = async () => {
|
||||
@@ -529,7 +557,8 @@ const openAddModal = () => {
|
||||
email: '',
|
||||
phone: '',
|
||||
address: '',
|
||||
notes: ''
|
||||
notes: '',
|
||||
isMannschaftsspieler: false
|
||||
}
|
||||
showModal.value = true
|
||||
errorMessage.value = ''
|
||||
@@ -544,7 +573,8 @@ const openEditModal = (member) => {
|
||||
email: member.email || '',
|
||||
phone: member.phone || '',
|
||||
address: member.address || '',
|
||||
notes: member.notes || ''
|
||||
notes: member.notes || '',
|
||||
isMannschaftsspieler: member.isMannschaftsspieler === true
|
||||
}
|
||||
showModal.value = true
|
||||
errorMessage.value = ''
|
||||
|
||||
@@ -245,7 +245,7 @@ const formData = ref({
|
||||
})
|
||||
|
||||
const canWrite = computed(() => {
|
||||
return authStore.role === 'admin' || authStore.role === 'vorstand'
|
||||
return authStore.hasAnyRole('admin', 'vorstand')
|
||||
})
|
||||
|
||||
const loadNews = async () => {
|
||||
|
||||
Reference in New Issue
Block a user