Toggle Firepad sync on occurrence of an event

185 Views Asked by At

Turn off firepad synchronization if access is revoked from the user (i.e when the password of firepad is changed). Also, grant access to the user if he enters the password correctly.


So far tried:

Removed access from user (by editing firebase-database security rules) which stops firepad synchronization but even after updating firebase-database security rules to grant access it synchronizartion doesn't work.


Is there a way to turn off firepad listener listening for changes and activate it again later?

or

How can the latest firepad synced code be retrieved from firebase so client's firepad can be updated on gaining access back.

1

There are 1 best solutions below

0
Michael Lehenbauer On

Sorry, but you can't really use security rules directly to toggle functionality in apps on/off because there's no way to be notified when you have access again. In general, if the app needs to know whether it has access or not, you'll need to store that in a separate location in firebase that the app can listen to and then respond appropriately (by enabling / disabling the Firepad UI or whatever).