preventing users from using certain options on a page

I'm trying too use the code found here on this page to prevent users from accessing the page when they are not the page creator and the field get_field('visitors_allowed_to_add_content is set to no on that memorial page

the full page code is found at