Check study access rights and study exists

 Fix #445
why do you add these hardcoded values here?