FileAsset lost after trying to save without permissions
If you try to save a FileAsset to a Site/Folder you don't have permissions to, you get the expected message, but then when you select a Site/Folder you do have permissions to save to, you get a message saying that the File Asset is required, meaning that it loses the already attached file.
Steps to reproduce:
- Edit Content Type 'File Asset' and give publish permissions to 'Contributor' Role
- Log in as 'Joe Contributor', go to Content Search and hit 'Add New Content' for type 'File Asset'
- Make sure selected Host or Folder is "demo.dotcms.com" and attach a file and click "Save / Publish". You will get a invalid permissions message.
- Choose the "resource" folder in the Host or Folder field and hit "Save / Publish" again. You will get a message saying "The field File Asset is mandatory."
https://www.screencast.com/t/n4UkHizZfg
PR: https://github.com/dotCMS/core/pull/12893
Passed QA, tested with contributor role on document and file asset content type, and tested with a role that inherits the contributor permissions... filer persists on the content even after fail due to host or folder attempt where permissions do not match.