Fixes the update permissions upgrade script
(cherry picked from commit 431cf48)