API
Version 7.x > API > NRE on Tree Traversal View modes: 
User avatar
Member
Member
developers-ecentricarts - 11/27/2013 9:52:27 AM
   
NRE on Tree Traversal
Above Kentico 7 hotfix 60, due to a new security wrapper/filter on the child node collection in the document engine assembly, some of our old node/document traversal code has been failing with with a Null Reference Exception.

Basically a node exists in the tree but the collection security filter isn't returning it and we get null instead.

We've had to add the following appsetting key into web.config to return to old behaviour and remedy the issue (this was found through decompiling the assembly - it's not mentioned in the hotfix notes that I can find).
<add key="CMSCheckPermissionsForDocumentCollection" value="false"/>

Is there a recommended way to use the API now based on this security filter change, rather than shutting off the feature with the app setting key?

User avatar
Member
Member
developers-ecentricarts - 11/27/2013 10:03:03 AM
   
RE:NRE on Tree Traversal
We can't find the appsetting key CMSCheckPermissionsForDocumentCollection documented in Appendix B - Web.config parameters of the 7 Dev Guide - http://devnet.kentico.com/docs/devguide/index.html?web_config_parameters.htm

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 11/28/2013 4:11:31 AM
   
RE:NRE on Tree Traversal
Hello,

The reason is that this is new web.config key which developers are preparing for version 8.
Not all the web.config keys are listed in the Developers Guide and probably never will be as some of them are supposed to be used just in a very specific cases. And this web.config key is one of them as this it is related to security and was introduced just with a specific hotfix version.

Best regards,
Martin Danko

User avatar
Certified Developer 8
Certified Developer 8
cheryl.macdonald - 1/7/2014 8:32:31 AM
   
RE:NRE on Tree Traversal
We have had the same problem on our build which was solved by adding that app setting key. What I don't understand is why we need it?? Our child nodes inherit permissions from the parent, and as the user can see the parent, why should we need to set a key that to say that we want to ignore permissions on the children to allow the user to see the children. The children should be available regardless.

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 1/7/2014 9:04:30 AM
   
RE:NRE on Tree Traversal
Hello Cheryl,

This code is required due to the security improvements our development team has deciced do implement already in the current version but I believe that in version 8 will be this web.config key documented or another API method available to achieve the same funcionality.

Best regards,
Martin Danko