add a js method to check the current permission