Fixed permissions check when users are not in the same group.

The check if users are in the same group erroneously returned true even
if they were not. This caused the actual permission check to fail and
thus prevent editing.