In the Council of Elrond
, Gandalf refers to his visit to Minis Tirith and the records held there. Saurman had often been a guest of the Lords of the City but Gandalf says about his own visit
Less welcome did the Lord Denethor show me then than of old, and grudgingly he permitted me to search among his hoarded scrolls and books.
From what Denethor then said to Gandalf I think that Denethor did not realise that Gandalf was as wise as Saruman especially in reading ancient lore and text and also Denethor himself was unable to understand the ancient scrolls etc, if indeed he even knew they existed.
But unless you have more skill even than Saruman, who has studied here long, you will find naught that is not well known to me, who am master of the lore of this City.
Gandalf then says
And yet there lie in his hoards many records that few now can read, even of the lore-masters, for their scripts and tongues have become dark to later men. And Boromir, there lies in Minas Titith still, unread, I guess, by any save Saruman and myself since the kings failed, a scroll that Isildur made himself.
I agree that Denethor may well have granted Gandalf access to the 'treasure' thinking to learn from him anything else that came to light but also it is possible that Denethor was somewhat arrogant in thinking he knew all there was worth knowing about the ancient scripts and that Gandalf would find nothing more there. Obviously Saruman did not share all his knowledge with Denethor so Denethor did know of the existence of Isildur's scroll.
I can find no other reference to why Denethor allowed Gandalf access to the scrolls either in LOTR, UT or Letters. I call upon Vir to double check if he will.
Something else that I hadn't quite realised before until I reread The Council of Elrond (and it may be off topic for this thread) but Faramir was the first of the brothers to have the dream about the Sword that was broken and then Boromir also had the dream but it was Faramir who wanted to set out to find Imladris. Boromir took the journey upon himself because of the dangers and Denethor was not eager or happy to give him leave to go. It may be that Denethor did not fully grasp the nature of their dream or what it meant or if he did know he did not share that knowledge with his sons. But he did eventually grant leave to Boromir to set out on the journey