Backporting fix from trunk r1626451
[OFBIZ-5675] Fix permission issues. Thanks Pierre Smits for bug report.
Thanks Deepak Dixit for fix.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/branches/release13.07@1626454 13f79535-47bb-0310-9956-ffa450edef68