Fix login errors regarding permission attachments