Fixed upload permissions distinction between public and logged in upload

Backport of 9cfb438ff7fd24ef5c81c4f2e075789d320016e2