prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 559 forks source link

How is the "Roles" example for react-router v4 + redux-auth-wrapper v2 supposed to be used? #982

Open tjvanderende opened 4 years ago

tjvanderende commented 4 years ago

Do you want to request a feature or report a bug?

Feature / enhancement

What is the current behavior? Its not clear where profile is coming from in the permission based example (last example from https://react-redux-firebase.com/docs/recipes/roles.html). Same example does also not check for permission, which makes it unclear how to get the permission parameters from the user profile.

What is the expected behavior? A full working example.

Could anybody give me a working example of implementing this with the proposed role/user structure off the above link? Its also unclear how to populate the roles, because the "populate" section in the documentation explains the profile parameters not automatically getting loaded anymore. However, its not clear how to load them with firestore.

TrySpace commented 3 years ago

I agree that it's not clear at all. I believe some of it is supposed to be used on server side, but not sure.

What I did find out is that using useFirestoreForProfile: true will default the profile stuff to firestore, yet it's not clear if the roles json example is to be used in firestore as well, according to https://react-redux-firebase.com/docs/recipes/roles.html you'd have keys like admin and user next to the userIds? idk the docs mention many variables as well that are practically unfindable, or without any context.

I feel this whole library is being used for 1 specific project, but no context is being given to us, the users, to how and where to implement certain things...