I’m a newbie here and my question may be already answered but I could not find it anywhere…
I want to implement a SuperUser that is allowed to see the data from everyone.
In order to keep the confidentiality of information between users I implement the “dataowner” concept and when I save any information I already save the current users’ unique ID.
The usual way to do it is to implement something like " ( (UserID = currentUser.UniqueID) OR (currentUser.SuperUser = true)) " in the constraint for the data searches.
But I did not find how to implement “OR” on constraints as well…
Can someone shed some light on it? I don’t believe I’m the first with this doubt.
Any reason why you aren’t using privacy rules? You can enable privacy on the specific data type, and just make the rule “Current User is This [thing’s] Creator”. And check all the boxes to see the data
Then make another rule “Current user’s SuperUser is yes” and have a field under the user called “SuperUser” with the type yes/no.
Then you don’t have to save the user’s unique ID for everything and don’t have to use any search constraints to keep privacy (all the privacy is handled internally in Bubble)
Yes… There is a reason…
I didn’t know about it!!!
Thanks for the help. I’ll check it out!
Add a field to the user as “Is admin?” of the type ‘yes/no’ .
Using privacy rules, to allow all things for them and for other roles remove everything.
Specific to your question, to search with an “OR” type.
Allow “Ignore empty constraints” by checking it at the bottom of Do a search menu.
More on this you can find it here.