Add JS for permissions check