When is it permissible to conceal a junction box in a wall or under a sidewalk?

When is it permissible to conceal a junction box in a wall or under a sidewalk?