I would like to prevent some users to see the comments and comment themselves.
They will use the email to communicate and the comments will be only used as a kind of intern chat for technicians.
Do you have any idea of the right way to manage to do that ?
Comments seem to be always accessible, regardless of the permission manager.
It would be easy if I could just tell which role can or cannot get access, but it is not working.
Another possiblity would be to add a function to modify the CSS related to the comments to hide them for certain users, but css can be easily modified by the end user so it is kind of pointless.
I can hide() or remove() the whole class ânew-timelineâ element or the class âtimeline-itemsâ elements, but even when the child element is correctly selected with a data-doctype filter, I canât remove it with a removeChild().
Do you have any idea of the reason and how to force the removal ?
To anyone interested to enable such a feature, here is how I finally managed to completely remove every comments (and only comments) of the timeline for a specific role :
if (!frappe.user.has_role(âXXXXXâ)){
document.querySelectorAll(â.timeline-item[data-doctype=Comment]â).forEach(comment => comment.remove());
}