Check study access rights and study exists

 Fix #445
The functions don't actually exist.