Most sites provide publicly accessible content. Therefore, the default post-publishing process will make the posts public. In sites with the free and premium content model, we need the ability to limit access to posts based on different conditions. One of the popular uses is user-specific posts or pages where only a specific user will see the post content.
In this recipe, we are going to limit post access to a selected single user by using a custom setting in the post-editing screen and block access to other users.