display user permissions
This commit is contained in:
parent
6f135af4a6
commit
8f23a688cb
4 changed files with 55 additions and 5 deletions
|
@ -1,5 +1,8 @@
|
|||
<template>
|
||||
<div class="flex flex-col gap-2 max-w-2xl mx-auto w-full select-none">
|
||||
<div
|
||||
class="flex flex-col gap-2 max-w-2xl mx-auto w-full select-none"
|
||||
:class="disableEdit ? ' pointer-events-none opacity-60 bg-gray-100/50' : ''"
|
||||
>
|
||||
<div class="flex flex-row gap-2 h-fit w-full border border-gray-300 rounded-md p-2">
|
||||
<input type="checkbox" name="admin" id="admin" class="cursor-pointer" :checked="isAdmin" @change="toggleAdmin" />
|
||||
<label for="admin" class="cursor-pointer">Administratorrecht</label>
|
||||
|
@ -8,7 +11,7 @@
|
|||
v-for="section in sections"
|
||||
:key="section"
|
||||
class="flex flex-col gap-2 h-fit w-full border border-primary rounded-md"
|
||||
:class="isAdmin ? ' pointer-events-none opacity-60 bg-gray-100' : ''"
|
||||
:class="isAdmin && !disableEdit ? ' pointer-events-none opacity-60 bg-gray-100' : ''"
|
||||
>
|
||||
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
|
||||
<p>Abschnitt: {{ section }}</p>
|
||||
|
@ -65,7 +68,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-row gap-2 self-end pt-4">
|
||||
<div v-if="!disableEdit" class="flex flex-row gap-2 self-end pt-4">
|
||||
<button primary-outline class="!w-fit" @click="reset" :disabled="canSaveOrReset">verwerfen</button>
|
||||
<button primary class="!w-fit" @click="submit" :disabled="status == 'loading' || canSaveOrReset">
|
||||
speichern
|
||||
|
@ -109,6 +112,10 @@ export default defineComponent({
|
|||
type: [Object, String, null] as PropType<null | "loading" | { status: "success" | "failed"; message?: string }>,
|
||||
default: null,
|
||||
},
|
||||
disableEdit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
permissions() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue