Check study access rights and study exists

 Fix #445
Right, I derped on that. Fixed.