Check study access rights and study exists

 Fix #445
Because that just returns the set of accessible studies without doing the check. I need to make sure the passed study_id is in that set.