moderate-tomatoM
Refine2y ago
9 replies
moderate-tomato

How can re-init accessControlProvider ?

``import { CanParams, CanReturnType } from "@refinedev/core"; const user = localStorage.getItem("user"); export const canPMP = async ({ resource, action, params }: CanParams): Promise<CanReturnType> => { const myProductRole = localStorage.getItem("myProductRole"); console.log({ myProductRole }); if (resource === "user" && action === "add") { return { can: true, }; } return { can: false }; }; My App started at studio resource. myProductRole has value once I navigated to product resource, but when I try to console.log it always null. How can I trigger can` fn to get new value in localStorage?
Was this page helpful?