If you've got the paths on grid, move it out of the way and then use the paths as a guide to build the barriers, then move the building back. You should be able to do the barriers without moving it, but I find it is usually easier to move things out of the way, get the barriers down, and then move things back with precision using the X key and then the arrows.
Either that, or just move it slightly and build the barriers just outside of it with it right there as a guide, then move it back. Or build the barriers incorrectly and then use the ability to select a post and drag it around to move it right where you need it, which is usually way more precise than just straight building it.
For this job, I'd probably use that last method, of building incorrectly and then dragging all the posts one at a time where I need them.
Many options, hope one works for you!