<script setup>

  const supabase = useSupabaseClient()

  const data = await supabase.from("profiles").select('* , tenants (id, name)')
  console.log(data)

  let rights = {
    createUser: {label: "Benutzer erstellen"},
    modifyUser: {label: "Benutzer bearbeiten"},
    deactivateUser: {label: "Benutzer sperren"},
    createProject: {label: "Projekt erstellen"},
    viewOwnProjects: {label: "Eigene Projekte sehen"},
    viewAllProjects: {label: "Alle Projekte sehen"},
    createTask: {label: "Aufgabe erstellen"},
    viewOwnTasks: {label:"Eigene Aufgaben sehen"},
    viewAllTasks: {label: "Alle Aufgaben sehen"},
    trackOwnTime: {label:"Eigene Zeite erfassen"},
    createOwnTime: {label:"Eigene Zeiten erstellen"},
    createTime: {label:"Zeiten erstellen"},
    viewOwnTimes: {label:"Eigene Zeiten anzeigen"},
    viewTimes: {label:"Zeiten anzeigen"},
  }

let roles = [
  {
    key: "tenantAdmin",
    label: "Firmenadministrator",
    rights: [
        ...Object.keys(rights)
    ]
  },
  {
    key:"worker",
    label: "Monteur",
    rights: [
        "viewOwnProjects",
        "createTasks",
        "viewOwnTasks"
    ]
  },
  {
    key:"manager",
    label: "Vorarbeiter",
    rights: [
        "createProjects",
        "viewOwnProjects",
        "createTasks",
        "viewOwnTasks",
    ]
  },
  {
    key:"booker",
    label: "Buchhalter",
    rights: [
        "createTasks",
        "viewOwnTasks",
        "createTime",
        "viewAllTimes"
    ]
  }
]


</script>

<template>






</template>

<style scoped>

</style>