Sounds like you're talking about row-level security, so this answer is related to that. Just as you can use the USERNAME() function to check for user security, you can use ISMEMBEROF() to check for group security. In Tableau Server, you can create Groups that would be used by the function above.
This article talks about this in detail: How to set up your Database for Row Level Security in Tableau | Tableau and Behold!
These other 2 articles are good to read too:
Hope this helps!