Has anyone used CASL.js? Can anyone please help if they are aware of any latest resources beside CASL.js docs? I am finding docs very confusing.
Most of the resources available online are for deprecated version.
Has anyone used CASL.js? Can anyone please help if they are aware of any latest resources beside CASL.js docs? I am finding docs very confusing.
Most of the resources available online are for deprecated version.
Hi @Naureen.Imran , these are the updated docs of casl.js specifically for ReactJs
Thank you @usman_siddique.
Do you know any other resouces? These docs are little confusing as code snippets do not mention the name of the files. It is not very clear which component is which.
@Naureen.Imran I don’t know about any other resources. I found the documentation quite helpful. You can share the code snippet and i can try to explain it
If you look at the first snippet in Can component. I dont understand how to use this snippet and if it is supposed to go in ability.js
export default ({ post }) => <Can I="read" this={post} field="title">
Yes, you can do this! ;)
</Can>
Yes, you are right. This is not how we use it, it is just an example. The component uses abilities, which can be custom defined. You can read about abilties here:
Once we have defined the abilities, then we can use it with the component.
You can find codesandbox examples using casl.js here: