dependent-tan
dependent-tan2y 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
refine-support-bot
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.
fair-rose
fair-rose2y ago
Currently, refine doesn't support this globally. Can you open an issue with feat flag for this?