Fix handling of permissions, fixes #80
messages: regard attachments
Merge remote-tracking branch 'origin' into studip-2.2