I am making an app where there are 3 Users. (User A, User B and User C) i just want that if user A and B submit some entries in the database then they can only view their entries but User C can see both User A and B entries. How can i accomplish it a little help regarding this matter will highly be appreciated.
Hi there, @it110… there are a number of ways to do what you described, but in the end, you will almost certainly want to control access to the data with privacy rules.
Without knowing exactly what your app does, one way you could go is to have a field on the User data type that stores a list of users (let’s call this field friend list), and each user would be allowed to access the data created by the users in their list. So, in your example, User A’s and User B’s friend list fields would be empty, but User C’s field would contain User A and User B.
With that setup in place, you would be able to create a privacy rule on any data type that allows access to the data when Current User's friend list contains This Thing's Creator, and you should be good to go. Make sense?
Hi mike I’m a little bit confused can u explain me graphically because I’ve created the field friend list but cant understand this one clearly. "So, in your example, User A’s and User B’s friend list fields would be empty, but User C’s field would contain User A and User B."
I’m not sure that screenshots are going to help (yet). It’s more of a question for you about how you define in your app that User C can access data created by User A and User B. Do users grant access to other users through an interface in the app? Or are you going to do it on the back end (i.e., in the editor)?
Taking a big step back, are you familiar with list fields and how you add items to a list?
This is my simple app i just want if user A logins in to the app then he can see only his entries same to user B but when User C logins then he can see all the entries of both users(A&B).
Sorry, but you literally gave me no new information, and you didn’t answer any of my questions. Anyway, here’s a screenshot of a list field in the User data type that would be part of the suggestion I wrote in my original response.
I can’t imagine how that screenshot could be helpful if you don’t understand lists and if you haven’t figured out how you might populate that list for each user, but well, it’s something.
Also, keep in mind that I was only giving you a suggestion as to how you might approach the situation that you only vaguely described. There are plenty of other ways to go… for example, users could be in departments, and you could have privacy rules around departments.
Have you worked through Bubble’s tutorials? Bubble is not the easiest platform to learn, and it’s pretty important (in my opinion) that you start with a good understanding of the basics. So, if you haven’t done those tutorials, I would take a step back and work through them before jumping right in to building your app.
Hi Mike,
I ve gone through almost all tutorials and create a list now with the name of trusted users and add users in that list and also created a privacy rule for that but the data is not shown in my repeating group ive also attached screen shot for your reference.
Congrats on getting through the tutorials… it really should help. It might be this that is getting in the way now, so check it out and see if that is the case.
Yes i have followed your instruction but it shows all the data now not specific to user.
i wrote this expression i dont know what iam doing wrong please guide me.
Thanks but i think i got it now i added the user in trusted user and now i got their entries only and added both users (User1 &2) in other user so i got their entries only.
Thanks soo much for your help