UNPKG

@nangazaki/vue-rbac

Version:

Role-Based Access Control (RBAC) implementation for Vue.js

3 lines (2 loc) 468 B
async function o(o,t,r=!1){o.isLoading=!0;try{const n=await fetch(t.apiEndpoint,t.fetchOptions);if(!n.ok)throw new Error(`Failed to load configuration: ${n.status} ${n.statusText}`);const i=await n.json(),s=t.transformResponse(i);return o.roles=r?{...o.roles,...s.roles}:s.roles,o.isInitialized=!0,o.roles}catch(o){throw console.error("Error loading RBAC configuration:",o),o}finally{o.isLoading=!1}}export{o as loadDynamicConfig}; //# sourceMappingURL=dynamic.js.map