Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Can I use it with React + Redux? Can some please provide an example? #141

Closed
awais-ehmad opened this issue Jan 2, 2019 · 2 comments
Labels

Comments

@awais-ehmad
Copy link

awais-ehmad commented Jan 2, 2019

Hi, can casl be used with the Redux Provider (Store). can somebody please provide me a working example?

@stalniy
Copy link
Owner

stalniy commented Jan 6, 2019

Hi,

Sure, you can use. But what is your usecase?

I don’t think you need to do some specific integration. But again it depends on what you want to do because the main goal of ACL on UI side is to provide consistent UX, not to confuse user with functionality which he is not allowed to use (similar to UI form validation). In that cases CASL/react package should cover almost every usecase.

The actual permission checks should be also done on backend and if user for some reason tried to get access to not allowed actions/resources, backend sends “permissions denied” response and you need properly react to it (e.g., show notification that resources/actions are not allowed)

@stalniy
Copy link
Owner

stalniy commented Jan 16, 2019

You can also check #148 for some details of how to update ability from redux state.

Close this due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants