Parent template name filter for Object Tools

Started by pvo, December 24, 2020, 01:26:44 PM

Previous topic - Next topic

pvo

I am not sure if it is a bug or a feature  ;).

I use "Parent template name should match the following template (comma separated regular expression list)" filter for some Object Tools. This works correctly if the user has at least Read access right to Templates. If the user does not have this right, the tool will not appear in the Command section of the Node.

I think think that is not the expected behavior because a normal user does not need to see Templates for his daily work, but he needs to use Object tools.

Would it be possible to solve this problem and allow using this filter without having the Read access right to Templates?

Victor Kirhenshtein

Hi,

this is a bug that cannot be solved easily. Object tool filtering for displaying in context menu is done on client side. If client application does not have access to templates it cannot check if node is in that template or not. This can be solved by sending filtering request to the server, but that will require round trip to server on each right click on object (possibly combined with some sort of caching and push notifications from server when template membership changes) - this can significantly slow down UI.
Alternative approach for such filtering could be by using custom attributes - you can use configuration poll hook to set custom attribute for each parent template and then in object tool check for those custom attributes.

Best regards,
Victor

pvo

Hi Victor,

thank you for the confirmation that it is an error and for the workaround.