CORE-3963: added code to prevent users from sharing or unsharing with themselves