Si j’ai une application pour allumer et fermer une lumière.
Est-ce qu’il est possible d’utiliser la même application par une autre personne qui pourra contrôler SA lumière et non la mienne ? Si je veux faire ceci, est-ce que je suis obligé de “cloner” l’application ou je peux avoir la même application avec 2 secret key?
Merci beaucoup
If I have an app to turn a light on and off.
Is it possible to use the same application by another person who will be able to control THEIR light and not mine? If I want to do this, do I have to “clone” the application or can I have the same application with 2 secret keys?
Thank you so much
Have you looked at the multi-user tutorial? Anvil | Multi-User Applications with Anvil
It covers how to store data for each user of an app, and prevent users from seeing data for other users.
thank you but this method, if I understood correctly, all users will be able to activate the same light. What I’m looking for is a way to use an application without having to clone it: with the same interface, client1 turns on its own light, client2 turns on its own light (and not client1’s) and so on without having to clone application x times. Thank you
Yes, it’s possible, as long as there is a way for your Anvil program to distinguish each individual light and each user.
- What identifies each individual light?
- How is that identifier used?
You create a multi user application, where each use can sign in, so the app knows which user is calling the server function.
Each user has his own settings, for example a secret key, stored in a table.
When user X logs in and calls a server function, the function gets the user’s settings from the table and uses it to turn on whatever it likes.
thank you very much, do you know where I could find an example or a tutorial to do what you are telling me about? I’m definitely a beginner but I love my new hobby. Thank you very much.
I watched the tutorial on multi-users mentioned above but I don’t find it clear enough for a beginner like me