Fixed check on upload permissions