corrected permission check on publish and share links (EPEDEV-170)