Add editable column for subuser grants and implement permission nodes selector component
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<script setup lang="ts">
|
||||
import { SessionUser } from "@/components/session/token/SessionUser.vue";
|
||||
import { SubuserGrants } from "@/components/session/token/SessionUser/Objects/SubuserGrants.vue";
|
||||
import { ref, defineProps, defineEmits, onMounted } from "vue";
|
||||
|
||||
|
||||
type PermissionNode = {
|
||||
"key": "BOOKINGS_DELETE",
|
||||
"name": "Delete Bookings",
|
||||
"description": "Allows the user to delete existing bookings",
|
||||
"type": "DELETE",
|
||||
"default": false
|
||||
}
|
||||
type PermissionNodeGroup = {
|
||||
"group": "Bookings",
|
||||
"description": "Bookings management permissions",
|
||||
"nodes": PermissionNode[]
|
||||
}
|
||||
const permissionNodes = ref<PermissionNodeGroup[]>([]);
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup>
|
||||
import ActionSettingsWheelButton from "@/components/displays/buttons/ActionSettingsWheelButton.vue";
|
||||
import ActionSettingsWheelItem from "@/components/displays/buttons/ActionSettingsWheelItem.vue";
|
||||
import EditableTableColumn from "@/components/displays/buttons/EditableTableColumn.vue";
|
||||
|
||||
defineProps(['objects']);
|
||||
|
||||
@@ -30,6 +31,10 @@ const formatDateTime = (dateString) => {
|
||||
<td>{{ grant.id }}</td>
|
||||
<td>{{ grant.subuser }}</td>
|
||||
<td>{{ grant.billing_customer_number }}</td>
|
||||
<editable-table-column
|
||||
:object="grant"
|
||||
column="enabled"
|
||||
/>
|
||||
<td>
|
||||
<span class="tag" :class="grant.enabled ? 'is-success' : 'is-danger'">
|
||||
{{ grant.enabled ? 'Ja' : 'Nej' }}
|
||||
|
||||
@@ -89,6 +89,11 @@ export const SubuserGrants = {
|
||||
}
|
||||
},
|
||||
},
|
||||
functions: {
|
||||
getPermissionNodes: async () => {
|
||||
return ObjectsGlobal.get.objects("/subusers/permission-nodes");
|
||||
}
|
||||
},
|
||||
get: {
|
||||
all: async () => {
|
||||
return ObjectsGlobal.get.objects(SubuserGrants.meta.endpoint);
|
||||
|
||||
Reference in New Issue
Block a user