/**
 * App Initialization (minimal)
 */

import type { App } from 'vue'

let userPermissions: Set<string> = new Set()

export function setUserPermissions(permissions: string[]) {
  userPermissions.clear()
  permissions.forEach(p => userPermissions.add(p))
}

export function hasPermission(permissionId: string): boolean {
  return userPermissions.has(permissionId)
}

export function installKbx(app: App) {
  app.config.globalProperties.$permissions = userPermissions
}
