<script>
import Swal from "sweetalert2";
import { authenticatedRequest } from "@/components/session/authenticatedRequest.vue";
import { ObjectsGlobal } from "@/components/session/token/SessionUser/Objects/ObjectsGlobal.vue";
import { SessionUser } from "@/components/session/token/SessionUser.vue";
import {ref} from "vue";



    /**
     * The Permissions object
     */
    export const Permissions = {
      meta: {
        title: "Tilladelser",
        icon: "fas fa-list",
        description: "Oversigt over tilladelser",
        endpoint: "/permissions",
        labels: {
          single: "tilladelse",
          multiple: "tilladelser"
        }
      },
      columns: {
        id: {
          label: "ID",
          type: "number",
          sortable: true,
          creation: {
            required: false
          }
        },
        name: {
          label: "Navn",
          type: "text",
          sortable: true,
          creation: {
            required: true
          }
        },
        description: {
          label: "Beskrivelse",
          type: "text",
          sortable: true,
          creation: {
            required: true
          }
        },
      },
        get: {
          all: async () => {
            return ObjectsGlobal.get.objects(Permissions.meta.endpoint);
          },
          single: async (id) => {
            return ObjectsGlobal.get.object(Permissions.meta.endpoint, parseInt(id));
          }
        },
    }
</script>