Fix condition when to apply SECURITY DEFINER.