MODX Revolution 2.1.3-pl (traditional)
Hi, I’m using element category access policies to prevent certain chunks being rendered to users with lower role (higher role number) in their user group.
This works fine when the page is marked uncacheable.
When the page is cached though, the sourcecache contains all the chunks, along with their policies, so it seems like the modParser _could_ be checking the policy on elements obtained from cache before returning the chunk (in modParser->getElement).
But it doesn’t - elements from sourcecache are returned regardless of policy - and I just wondered if this is intentional, and if so, why are the policies cached at all by the modParser?
(I should probably note that the chunks are referenced as uncacheable [[!$chunkName]], so the results are not cached)
Cheers, Martin.
-
MODX Staff
- 10,725 Posts
They should definitely apply, though remember, anything cached by a user that has access would technically be cached into the page content and elementCache so you would get unexpected results depending on what your elements contained. You never want to cache anything that has access control applied, as the permissions for the first user to access the page would control what is being cached.
That said, any uncached elements called in the page should definitely respect the ACLs.