camptocamp/c2cgeoportal — pull request #1113 by asaunier (2014-10-09 16:00:26+00:00)
Title: Make sure the cached list of private layers is kept untouched

Function _get_private_layers() returns the list of non public layers. To avoid subsequent DB queries, its result is dogpile cached.

The list of layers is then manipulated (the layers that are actually accessible to the current user are removed). The problem is that the cached list is impacted by those changes. Which means that the next time the cached list is called, it is no longer in its initial status (layers may be missing).

To avoid this issue, the PR makes sure the cached list is not directly manipulated, only a copy.