I know for a fact that some masters disliked crew getting shore leave because of the problems it could bring back with it. Lads being lads would want to go up the road for a bit of shopping , a few beers and just enjoy themselves D&A policy has a lot to answer for. I know that some masters would ask the shore side agents to send an email to the ship saying no shore leave at this port due to security concerns.
Just imagine what it is like now with COVID not only no shore leave but also in a lot of places no crew reliefs.

We had a great engineering super in BP I did a few dry dockings with him in Singapore & Ferrol in Spain. When he joined in drydock at the his first morning meeting he would request/suggest that as far as he was concerned the D&A policy only applied when a vessel was at sea, so a nod is as good as a wink to a blind horse.
My favourite dry dock was Navantia ship yard in Ferrol Spain. The quality of the work was excellent, the yard we were in was the Spanish Naval yard. But what was ideal you could walk into the town centre in 20 minutes to really great bars & restaurants, cheap as chips.