"then ends at some locked gates"
It's some years since I've been there.
There was a time when the gates weren't locked. After that it was possible to squeeze under one of the gates (even with a bike!)
Security used to be almost non existent. But over the years things have changed (not just Leith Docks) - rabies, man killed when car went in the water, general 'health and safety' in an industrial environment, then terrorism.
OUGHT to be possible to get a walk/cycle through that section of docks without compromising security/safety. (Long term "Boardwalk" plan.)