Go to File >> Add Data Tables >>
Select Connection to
"SQL Server" (This could be any database type that supports custom queries)
In the next dialog, provide server authentication method, username password as required.
Hit the connect button
If connection is successfull you should be able to select a database
Select a database and in the "Views in Connection" windows select Custom Query >> New Custom Query
In the Query window, add a query name, then at the bottom hit the parameters tab and check the box at the bottom "User parameters for personalized Queries"
Then write in the query, you can use parameters like ?current_user, ?current_group or ?current_domain.
These values are filled up by spotfire at run time based on User login information and can be used to restrict data based on user access.