Action values
What are the values that Refine uses for
action
in the context of access control? So far I've come across: list
, show
, edit
, delete
& create
. Is there a type or interface that defines them and that can be used to reference them programatically?1 Reply
Hi @Nitai. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
In Refine, the
action
values used in the context of access control and other functionalities include list
, show
, edit
, delete
, create
, and clone
. These actions are used to define what operations can be performed on resources.
The action
values can be referenced programmatically using the useResourceParams
and useResource
hooks, which provide the action
property. Here are the relevant details:
useResourceParams
Hook
The useResourceParams
hook provides the action
property among others:
Source (https://refine.dev/docs/routing/hooks/use-resource-params/#properties)
useResource
Hook
The useResource
hook also provides the action
property:
Source (https://refine.dev/docs/routing/hooks/use-resource/#return-value)
Access Control Provider
The Access Control Provider
uses these actions to determine if a user can perform a certain action on a resource:
Source (https://refine.dev/docs/guides-concepts/authorization/#access-control-provider)
Command Palette
The refine-kbar
package also uses these actions to create default actions:
Source (https://refine.dev/docs/packages/command-palette/#actions)
These hooks and providers ensure that the actions are consistently referenced and used throughout your Refine application.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------