We would like to use Firepad in our (mainly, not in Firebase hosting) project, but we have some problems that determine the best way to approach the problem.
Basically, we have many users, and each user can be a member of many groups. These "groups" have their own Firepad, which users can edit. We already have a deep database structure using MySQL, and we donβt want to transfer our user data to Firebase now, so we decided that we would get a more creative approach.
We do not want users to be able to edit Firepads of groups to which they do not belong. Thus, as part of our authentication token, we decided that we would try to send by user ID and list of groups to which they belong. Then, using the Firebase JSON security system, we can verify that the edited Firepad is in the list of groups to which the user belongs.
The problem is that the JSON system does not seem to accept many commands. There is no indexOf there, and I cannot call hasChild in the auth variable.
How can we guarantee that users can only edit the Firepads of the groups to which they belong, without transferring all our data to Firebase? (Or saving two copies of the database - one on MySQL and one on Firebase)
source share