other-emerald2y ago

How to hide buttons globally based on access control.

I want to hide the action buttons instead of disabling it. I knew that we can do that on button level using hideIfUnauthorized, but is there a way like on Refine options where I can set the value to hide on every buttons?
2 Replies
Hi, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and found an answer! 🏆
Answer: You can use the accessControl prop with the hideIfUnauthorized property to hide buttons globally based on access control. SOURCES: ./docs/api-reference/mui/components/buttons/list.md, ./docs/api-reference/mantine/components/buttons/show.md, ./docs/api-reference/mantine/components/buttons/create.md, ./docs/api-reference/mantine/components/buttons/edit.md

Note: If this is the answer you need, then we are very lucky. If not, please wait for someone from the refine core team or the community to try to help you.
harsh-harlequin2y ago
Currently, refine doesn't support this globally. Can you open an issue with feat flag for this?