#42826 by jvandyk, mfb, macgirvin. Only show 'edit primary links' link if the user has access to it. backport from HEAD