{"version":3,"file":"hasPermission-CeZMIjx4.js","sources":["../../../resources/js/Composables/hasPermission.js"],"sourcesContent":["import {usePage} from '@inertiajs/vue3';\n\n/**\n * Check if the current user has the specified right.\n *\n * @param {string} permissionKey - Permission key (for example, 'ban_users')\n * @returns {boolean} - true if the right exists, otherwise false\n */\nexport function hasPermission(permissionKey) {\n    const can = usePage()?.props?.auth?.can ?? {};\n\n    return !!can[permissionKey];\n}\n"],"names":["hasPermission","permissionKey","usePage"],"mappings":"gYAQO,SAASA,EAAcC,EAAe,WAGzC,MAAO,CAAC,IAFIC,GAAAA,GAAAA,EAAAA,EAAS,IAATA,YAAAA,EAAW,QAAXA,YAAAA,EAAkB,OAAlBA,YAAAA,EAAwB,MAAO,CAAE,GAEhCD,CAAa,CAC9B"}