fix Unauthorized in SQLCatalog_trimInventoryCacheOnCatalog.

also fix filter for SQLCatalog_trimInventoryCacheOnUncatalog same as SQLCatalog_trimInventoryCacheOnCatalog.