Check study access rights and study exists

 Fix #445
`self.assertTrue(self.user.has_study_access(1)`