const client = useKindeClient();
const {data: permissions} = await useAsyncData(async () => {
const {permissions} = (await client?.getPermissions()) ?? {};
return permissions;
});
// { orgCode: 'org_1234', permissions: ['create:todos', 'update:todos', 'read:todos'] }
const {data: hasAccess} = await useAsyncData(async () => {
return (await client?.getPermission("create:todos")) ?? {};
});
// { orgCode: 'org_1234', isGranted: true }
const client = useKindeClient();
const {data: permissions} = await useAsyncData(async () => {
const {permissions} = (await client?.getPermissions()) ?? {};
return permissions;
});
// { orgCode: 'org_1234', permissions: ['create:todos', 'update:todos', 'read:todos'] }
const {data: hasAccess} = await useAsyncData(async () => {
return (await client?.getPermission("create:todos")) ?? {};
});
// { orgCode: 'org_1234', isGranted: true }