Restrict Unlicenced users to view comments
Asked by Michael Schiller:

Hallo Communicty,

I would have a question and I hope one of you already knows an answer to this.

We are using confluence for our Customers. Lately, we see the need to have "internal" discussions on spaces and we would like to use the comments for that. As it is standard, our Unlicenced customers that have access to our Service Desk, can access the spaces and also see the comments sections. Is there a way how to change that permission like you can do it in Service Desk?

Or is there any other way to have internal discussions on the page that the customers cannot read?

thanks!

br

Michael


Answers:
author: Thiago Masutti
body: Hi [@Michael Schiller](/t5/user/viewprofilepage/user-id/4230983)

Welcome to the Atlassian Community.

The ability to adjust a *view comments permission* is logged as a feature request in [CONFSERVER-5639](https://jira.atlassian.com/browse/CONFSERVER-5639).

While this is not implemented, you might be able to work around it with some additional customization.

Confluence relies on [Velocity](https://developer.atlassian.com/server/confluence/confluence-objects-accessible-from-velocity/) for many of its UI components.

The Velocity template that regulates the Page display in the UI is **\<*confluence-install*\>/confluence/decorators/page.vmd**.

The portion in this template that display the comments section is the following:

```
#applyDecorator("root")
   #decoratorParam("sitemeshPage" $sitemeshPage)
   #decoratorParam("page" $page)
   #decoratorParam("context" $comments)
#end
```

You can customize this layout in a way that only authenticated users that has editing permissions would be able to see the comments section.

This layout can be customized on a Space-level by:

1. Access the target Space.
2. Go to *Space Tools* \> *Look and Feel*.
3. Go to the *Layout* tab.
4. Search for the **Page Layout**.
5. Click on *Create custom* for the Page layout.
6. Search for the section mentioned earlier and change it as follows

   ```
   #if ($permissionHelper.canEdit($authenticatedUser, $action.page))
      #applyDecorator("root")
         #decoratorParam("sitemeshPage" $sitemeshPage)
         #decoratorParam("page" $page)
         #decoratorParam("context" $comments)
      #end
   #end
   ```

7. Click on Save.

When an authenticated user, with proper permissions, access any page in that Space, the comments section will be presented as usual.

![comments-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/126562iF079038CBDA858F8/image-dimensions/501x292?v=v2 "comments-1.png")

If an unauthenticated (anonymous) user access the same page, then this section isn't presented in the UI.

![comments-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/126563iC1994DFECB6B3B12/image-dimensions/535x321?v=v2 "comments-2.png")

It's important to note that you may customize this layout as you wish and this is just a sample of a possible workaround.

While Atlassian Support won't assist you with customization, the product is flexible enough if you know what you are doing and the consequences.

I hope that helps.

Kind regards,  
Thiago Masutti

comments: author: Thiago Masutti
body: [@Michael Schiller](/t5/user/viewprofilepage/user-id/4230983)

I've made some changes to the above suggestion and created a document for it.

Please check it and let me know if that helps you.

[https://confluence.atlassian.com/confkb/how-to-hide-page-ui-elements-from-confluence-anonymous-users-for-a-specific-space-697139365.html](https://confluence.atlassian.com/confkb/how-to-hide-page-ui-elements-from-confluence-anonymous-users-for-a-specific-space-697139365.html?_cachebust=1735442907)

Regards,  
Thiago


author: Michael Schiller
body: [@Thiago Masutti](/t5/user/viewprofilepage/user-id/1209618): Worked like a charm! thank you. Looking forward for the permission settings in the future but for now, it is exactly what I was looking for.

Thanks!


Tags: confluence-server

server