We have a page where certain files links should be shown only to some users, because other users should not see them. I have attached those files to a page where the permissions are properly limited.
I thought that would hide links to those attachments from users who had no permission to see the files. Instead, the link is there but nothing happens if the user with no permissions clicks on it.
I tried using a page excerpt instead, but that showed a message to the no-permissions user about how they had no permissions to the attachment.
Is there another way to achieve the goal, that is, hiding the links entirely from users who don't have permission to view the attachments?