rising-crimson
rising-crimson4mo ago

How to pass an argument to usePermissions

in authProvider, I am expecting an argument in getPermissions, how do I pass the argument in usePermissions?
5 Replies
kapa.ai
kapa.ai4mo ago
Hi @Cavdy. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The information extracts provided do not include details on how to pass an argument to usePermissions in authProvider. However, you can refer to the usePermissions documentation (https://refine.dev/docs/authentication/hooks/use-permissions/) for more details. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4mo ago
<@425445331950632970> kapa.ai is still learning and improving, please let us know how it did by reacting below
rising-crimson
rising-crimson4mo ago
I had to create a hook wrapper around the usePermissions and used it this way as workaround till I get a standard way of doing it with refine import { usePermissions } from "@refinedev/core" import userService from "services/user.service" export const useGetPermissions = (tenantId: string) => { return usePermissions({ options: { queryKey: ['permissions', tenantId], queryFn: () => userService.getUserPermissions(tenantId) }}) }
extended-salmon
extended-salmon4mo ago
Hello @Cavdy, If you want, you can open feature request issue on GitHub
rising-crimson
rising-crimson4mo ago
Alright @Alican Erdurmaz I will give it a try