If we take a look at the Permissions and Restrictions page, we can note the following statement:
If someone doesn't have 'View' space permission, links to pages in that space won't be shown at all.
However, in Confluence 5.8.x versions, this operation does not match with this statement. If you put a link to a page inside a space that you do not have the view permissions, it will be redirected to a "Page not Found" message. If the user does not have the permissions to view the space, the links will still be displayed and once you click, a page not found.
This is a request to change the documentation or check if this is a bug that can be fixed in the system.
However, this could be also a request to remove this function from the system, if it was supposed to be implemented. The reason would be that removing/hiding links could affect on the proposal of the page.
For example, if the link is tied to a word in a text, if it would not be displayed for the user, it could affect on reading the text, once it would be missing some words. It could be kept only for direct links, in example, only pasting the page URL to a page without having it tied to a word.