Run below query as the user for whom you would like to know all the accessible DBs.
Query:
SELECT [Name] as DatabaseName from master.dbo.sysdatabases
WHERE ISNULL(HAS_DBACCESS([Name]),0)=1
ORDER BY [Name]
Results:
DatabaseName |
master |
model |
msdb |
tempdb |
.