Part of the challenge with building a custom interface for Tableau Server is finding Tableau Server user permissions. In building a custom view a year or so ago I ran into this and did some reverse engineering of the Tableau Server user permissions inside the PostgreSQL database.
Here is the code, do what you wish with it but be careful as access directly to these tables isn't supported by Tableau.
If you want to dive deeper checkout any of the 5 Tableau courses we have on our site plus the ~150 other data related topics. All for $29/mo!