Updated database_list function to be only show databases valid for the current user.
Added permissions checks to all other database functions