|
|
@@ -49,7 +49,7 @@
|
|
|
descricao="Alunos"
|
|
|
:feminino="false"
|
|
|
no-api-call
|
|
|
- add-item
|
|
|
+ :add-item="canAdd"
|
|
|
:loading="isLoading"
|
|
|
@on-add-item="onAddStudent"
|
|
|
>
|
|
|
@@ -73,6 +73,7 @@
|
|
|
<q-td auto-width>
|
|
|
<q-item-section class="no-wrap" style="flex-direction: row">
|
|
|
<q-btn
|
|
|
+ v-if="canEdit"
|
|
|
outline
|
|
|
icon="mdi-account-edit-outline"
|
|
|
style="width: 36px"
|
|
|
@@ -80,6 +81,7 @@
|
|
|
@click.prevent.stop="onEditStudent(row)"
|
|
|
/>
|
|
|
<q-btn
|
|
|
+ v-if="canDelete"
|
|
|
outline
|
|
|
icon="mdi-trash-can-outline"
|
|
|
style="width: 36px"
|
|
|
@@ -102,6 +104,7 @@ import DefaultTable from "src/components/defaults/DefaultTable.vue";
|
|
|
import DefaultInputDatePicker from "src/components/defaults/DefaultInputDatePicker.vue";
|
|
|
import { getStudents, deleteStudent } from "src/api/student";
|
|
|
import { userStore } from "src/stores/user";
|
|
|
+import { permissionStore } from "src/stores/permission";
|
|
|
|
|
|
const AddEditStudentDialog = defineAsyncComponent(
|
|
|
() => import("src/pages/students/components/AddEditStudentDialog.vue"),
|
|
|
@@ -113,6 +116,16 @@ const EditStudentDialog = defineAsyncComponent(
|
|
|
|
|
|
const $q = useQuasar();
|
|
|
const store = userStore();
|
|
|
+const permissions = permissionStore();
|
|
|
+const canAdd = computed(() =>
|
|
|
+ permissions.getAccess("franchisee_students", "add"),
|
|
|
+);
|
|
|
+const canEdit = computed(() =>
|
|
|
+ permissions.getAccess("franchisee_students", "edit"),
|
|
|
+);
|
|
|
+const canDelete = computed(() =>
|
|
|
+ permissions.getAccess("franchisee_students", "delete"),
|
|
|
+);
|
|
|
|
|
|
const rows = ref([]);
|
|
|
const isLoading = ref(false);
|