made has_acces function, fixed queries to allow joins on datasets you have access to