then-purpleT
Refine3y ago
4 replies
then-purple

Case 0 not working

  accessControlProvider={{
              can: async ({ resource, action }) => {
                let can = false;
                const role = getUserRole();
                     
                if (role) {
                  switch (role) {
                    case 0:
                      console.log("User");
                      can = resource.startsWith('user/');
                      break;
                    case 2:
                      console.log("Admin");
                      can = resource.startsWith('admin/');
                      break;
                  }
                }
                return Promise.resolve({ can });
              },
            }}

Case 0 not working
I also want to clear cache on screen after new login
Was this page helpful?