fixes #4994
Merge pull request #4997 from dotCMS/issue-4994-security-failure-on-cache-flush

fixes #4994