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

Automatically display an "Internal Only" warning based on page permissions

Pierre Hilson September 3, 2013

I'm building a knowledge base which will contain 'internal only' articles that should not be readable/searchable by anonymous users.

To achieve this, 'internal only' documents will be restricted in view for anyone but internal people.

Is there any way (user macro) to display a panel depending on the page restrictions ?

Thank you.

Pierre

2 answers

1 accepted

2 votes
Answer accepted
Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2013

You can get a list of a page's permissions by doing this:

#set($permsList = $content.permissions)

This sets permsList to an ArrayList of com.atlassian.confluence.security.ContentPermission objects (with type, userName, groupName properties). You can then iterate over it and draw your panel based on a particular value as you would any ArrayList.

hth,

matt

Pierre Hilson September 4, 2013

Thank you very much. This is what I was looking for (although I'm not used with the macro creation, I'll give it a try)

Matthew J. Horn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 4, 2013

No problem. Feel free to ask more macro-related questions.

0 votes
Septa Cahyadiputra
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 3, 2013

Hi Pierre,

Judging from your query you would want to hide some section of a page from anonymous users, if that is the case, you might want to use ServiceRocket Visibility Plugin. The plugin will allow you to hide a section of a page which could be a warning.

Hope it helps.

Cheers,
Septa Cahyadiputra

Pierre Hilson September 4, 2013

Your suggestion would make a section appear based on the viewer permissions.

I'm looking on a way to make a section appear based on the page permissions.

Thank you anyway for your time.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events