Fix impersonate's permissions check