Issue #22564:correctly handle restricted items