LPS-50653

Hey Sergio,

This is an interesting bug so I'll explain what I came across.

LPS-32718 fixed the issue where users who did not have view permission on a Document Type could still add a document of that type (by using DLFileEntryTypeServiceUtil instead of DLFileEntryTypeLocalServiceUtil). However, it also changed some other logic that broke the ability to set a workflow on all document types. Now, in Master, when setting a Workflow on a folder, the user must choose a document type or else they cannot add any files to the folder. This is complicated further when upgrading from 6.1 to 6.2 because after the upgrade, users can no longer add files to their previously working folders.

LPS-43031 further enforced the above by throwing an error when there are no document types specified, so it is impossible to set a Workflow for all document types in a folder.

For my fix, I completely reverted LPS-43031 since it was enforcing the wrong behavior and I did a partial revert of LPS-32718. Since we are now checking the view permission when we fetch the document types, it is fine to return all of them and in so doing we gain back the ability to set a workflow for all document types.

I tested LPS-32718 and that issue does not occur with my fix in place. Also, LPS-43031 is not an issue any more due to the partial revert of LPS-32718.

Please let me know if you have any questions or any issues with the pull. It's quite a complicated one and I'm not entirely sure this is the best way to go about fixing it. Thanks.