|
|
@@ -99,6 +99,7 @@
|
|
|
<div v-show="currentTab === 'comentarios'">
|
|
|
<div class="flex justify-end q-mb-sm">
|
|
|
<q-btn
|
|
|
+ v-if="canAdd"
|
|
|
color="primary"
|
|
|
icon="mdi-plus"
|
|
|
unelevated
|
|
|
@@ -123,6 +124,8 @@
|
|
|
:reply="reply.reply"
|
|
|
:created-at="reply.created_at"
|
|
|
:user-name="reply.user_name"
|
|
|
+ :can-edit="canEdit"
|
|
|
+ :can-delete="canDelete"
|
|
|
@edit="onEditComment(reply)"
|
|
|
@delete="onDeleteComment(reply)"
|
|
|
/>
|
|
|
@@ -137,6 +140,7 @@
|
|
|
<div v-show="currentTab === 'midias'">
|
|
|
<div class="flex justify-end q-mb-sm">
|
|
|
<q-btn
|
|
|
+ v-if="canAdd"
|
|
|
color="primary"
|
|
|
icon="mdi-upload-outline"
|
|
|
unelevated
|
|
|
@@ -170,6 +174,7 @@
|
|
|
:mime-type="media.mime_type"
|
|
|
:created-at="media.created_at"
|
|
|
:user-name="media.user_name"
|
|
|
+ :can-delete="canDelete"
|
|
|
@delete="onDeleteMedia(media)"
|
|
|
/>
|
|
|
</template>
|
|
|
@@ -182,7 +187,7 @@
|
|
|
|
|
|
<q-card-actions align="right" class="q-px-md q-pb-md" style="flex-shrink: 0">
|
|
|
<q-btn outline color="primary" label="Cancelar" @click="onDialogCancel" />
|
|
|
- <q-btn color="primary" label="Salvar" type="submit" :loading="loading" />
|
|
|
+ <q-btn v-if="card?.id ? canEdit : canAdd" color="primary" label="Salvar" type="submit" :loading="loading" />
|
|
|
</q-card-actions>
|
|
|
</q-form>
|
|
|
</q-card>
|
|
|
@@ -215,6 +220,7 @@ import {
|
|
|
uploadKanbanMedia,
|
|
|
deleteKanbanMedia,
|
|
|
} from "src/api/kanban_media";
|
|
|
+import { permissionStore } from "src/stores/permission";
|
|
|
|
|
|
defineEmits([...useDialogPluginComponent.emits]);
|
|
|
|
|
|
@@ -227,6 +233,10 @@ const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } =
|
|
|
useDialogPluginComponent();
|
|
|
|
|
|
const $q = useQuasar();
|
|
|
+const permissions = permissionStore();
|
|
|
+const canAdd = permissions.getAccess("franchisor_activities", "add");
|
|
|
+const canEdit = permissions.getAccess("franchisor_activities", "edit");
|
|
|
+const canDelete = permissions.getAccess("franchisor_activities", "delete");
|
|
|
|
|
|
const formRef = ref(null);
|
|
|
const loading = ref(false);
|