accessControlProvider behaviour
Hi friends!
i've got problem with accessControlProvider
in our application we have role mode that fetching from backend and i need to use it
but than i put request for profile in 'can' method - it makes many requests for profile(
maybe i do something wrong?
![No description](https://cdn.answeroverflow.com/1080878929931411517/image.png)
5 Replies
Hey, 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 could not find an answer. Please wait for someone from the refine core team or the community to try to help you. 👊
deep-jade•2y ago
and after this implementation i see this in network)
![No description](https://cdn.answeroverflow.com/1080879182889881650/image.png)
fair-rose•2y ago
https://refine.dev/docs/api-reference/core/providers/accessControl-provider/#usage
Hello @amounguluz It's an expected behaviour, we are checking for each resource.
Access Control Provider | refine
Access control is a broad topic where there are lots of advanced solutions that provide different set of features. refine is deliberately agnostic for its own API to be able to integrate different methods (RBAC, ABAC, ACL, etc.) and different libraries (Casbin, CASL, Cerbos, AccessControl.js). can method would be the entry point for those soluti...
deep-jade•2y ago
yes, but i made this screenshot on list page and than it fetched data and render list
and this method (can) was executing on any row render
on network you can see how many requests after that ...
Hey @amounguluz ,
This is an expected behavior. The '<DeleteButton>' component calls the 'can' method of the accessControlProvider during rendering. You can find more details here: https://refine.dev/docs/api-reference/core/providers/accessControl-provider/#buttons.
If you want to prevent this, you can refer to this document: https://refine.dev/docs/api-reference/antd/components/buttons/delete-button/#accesscontrol."