permissions: raise the proper error when the IP is not provided

(cherry picked from commit a4f849d3e6553182205fabd1dfbdf5c21005e188)