Hide Comments or Commenter Name for Specific User Roles?

As the title says,

I have Roles that are not allowed to see the comments and other Roles that are allowed to see the comments but not the commenter name.

Is there any way to do this?

1 Like

Reference: Hide Add Comment - #2 by NCP

Hey Nihantra, thank you for your reply.

I read the comment you referenced, but it only addresses part of my question. I still need to hide the commenter’s name in certain cases while keeping the comment visible.

Here’s the use case:
If an auditor adds a comment on a Payment Entry, I want to ensure the accountant doesn’t know which auditor made the comment, to avoid any potential personal conflicts.

Please apply it.

$('span.avatar.avatar-medium').hide();
$('span.ml-2').hide();

While this solution does hide the elements, I don’t think it fully solves the issue.

Hiding the front-end elements will still load the data, which can easily be revealed through browser tools like Inspect Element. This brings us back to the original problem, where the user can still identify who commented.

One possible solution is to replace or empty the name field, using something like “Anonymous” or “Unknown,” and update the avatar accordingly, using the same method you suggested.

Thank you so much! :blush: