[TECHNICAL-SUPPORT] LPS-32718 Document Library & Display portlets - Make document type (DLFileEntryType) permission check more consistent

Hey Sergio,

Unfortunately, I didn't have time to work on this pull, and if I take a look at my other support tasks, I must say I could not finish it in a reasonable time. So, I would like you to takeover it, if you can.

I'm sending the original commits on a rebased source.

Regards,
Tibor