Check study access rights and study exists

 Fix #445
needed for the page to render, since the template is expecting these values.