Instead of using a separate table for TeamAdmins, I would just add a true/false property to your Users collection. Call it “Admin” and set the field to true for any users who are also Admins. Then make the button visible if User > Admin is true.
Instead of using a separate table for TeamAdmins, I would just add a true/false property to your Users collection. Call it “Admin” and set the field to true for any users who are also Admins. Then make the button visible if User > Admin is true.
All TeamAdmins>Count>is equal to>1. And add a filter that User’s> ( I guess this is a One to Many to relationship between User and TeamAdmins ) email>is equal to>Logged in user’s> email.
Or you can create a Many to Many relationship between Users and Teams and add Current Post>Team’s>Users ( Many to Many relationship )>All>Contains>Logged in user.I have read some posts that when the users count increases in that relationship this will become slow. And they suggest to use Joint Tables like this. Not sure.
The 2 ways? As for my knowledge the 1st way should work and the 2nd the way has to work for sure.
This logic is there when you use Many to Many relationships but Logged in user is in down in the filter as like Current Team>Admins>Contains>Logged in user or Current Team>Admins>Does not contains>Logged in user
For the first way, I have one to many relationship between User and TeamAdmin. Here is what I see on the screen. I don’t understand how you enter:
All TeamAdmins>Count>is equal to>1. And add a filter that User’s> ( I guess this is a One to Many to relationship between User and TeamAdmins ) email>is equal to>Logged in user’s> email.
Ah I guess I understand what you want to do! You have a post and that post belongs to a Team and if that Team’s admins view that show the button and if not don’t show. Correct?
Then you need to add the filter like this ( same but select current post>team’s>admins>count ) :
I guess I don’t fully understand the logic behind why the filter on Count = 1 ???
If viewed in a web browser, would a non-TeamAdmin be able to go to a specific URL and edit or add posts as if they were a TeamAdmin? Just wondering how “secure” these visibility settings are???
It’s like if the Logged in user is in the Admins table. Like if there is a record that is the Logged in user then the count becomes 1 and button displays. But if Logged in user is not on that Table then button is not visible.
I believe they are secure! If that user is not a admin then that user should not see the button.