sensitive-blue
sensitive-blue3mo ago

Hi! Can somebody help with one thing

Hi! Can somebody help with one thing that I couldn't resolve with kapa? In my app I have an accessControlProvider, and it works fine with all the resources and actions. The problem is with the routes that are not asociated with a resource or with an action that is not in the default list, for example I have created a custom route, that has nothing to do with any resource, and when I access to this route, my can function is executed with undefined resource and empty action. How can I to avoid to run the can function in this case? or how can I receive the correct action or resource? right now I edited my can function to return {can: true} if the action is not in ["list", "create", "edit", "show", "delete"] but I think that is not the best behavior. Thanks!
1 Reply
wise-white
wise-white3mo ago
Hello @Jaoc1811 If you don't wrap your page with <CanAccess> or if you don't use useCan, can function shouldn't be executed 🤔 can you provide reproducible example to debug, please ?