Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Restrict Unlicenced users to view comments

Michael Schiller January 20, 2021

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

2 answers

1 accepted

0 votes
Answer accepted
Thiago Masutti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 20, 2021

Hi @Michael Schiller 

Welcome to the Atlassian Community.

The ability to adjust a view comments permission is logged as a feature request in CONFSERVER-5639.

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

Confluence relies on 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

 

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

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

Thiago Masutti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2021

@Michael Schiller 

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

Regards,
Thiago

0 votes
Michael Schiller January 22, 2021

@Thiago Masutti: 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!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events