[utils] - Update restrict function middleware