Please either return before this line if allowed_globals is true or shortcircuit this into the next line to prevent the has_perm call if not necessary.