R
Refine

ask-any-question

How to hide buttons globally based on access control.

Sstormy-gold3/1/2023
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?
Fflat-fuchsia3/1/2023
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.
Aabsent-sapphire3/1/2023
Currently, refine doesn't support this globally. Can you open an issue with feat flag for this?

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server