Bypass restriction and allow access to post when criteria are met

Hello

Is it possible to allow access to a post page bypassing all restrictions when criteria are met? For example when a query string variable match the value of a custom field assigned to a post.