How to hide export to pdf if user does not have space export permission in confluence

Crs co November 21, 2018

Hi,

I want to limit the access of exporting for some of the Users which for example does not have space export access,

I know that I can disable it from plugin setting or I can hide it by writing java-script in header of the page, but in the second method, I need to limit it just for some user, for example leaders needs to have access for exporting but some others not,

how can I add scripts in header to check if the user has space export permission can see the export to PDF item.

thank you so much.

2 answers

1 accepted

1 vote
Answer accepted
Crs co November 24, 2018

Hello,

I added the below codes in Space layout and it works.

#if ($permissionHelper.canExport($authenticatedUser, $action.page))
<script type="text/javascript">
AJS.$('#action-export-pdf-link').hide();
</script>
#else 
#end
0 votes
kennyngkk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 22, 2018

Hey There, 

 

We actually have an article for this. Please refer to it below. 

Crs co November 23, 2018

Dear @kennyngkk,

thank you for your answer, actually solution in your link will disable Export for all the users, I need to write a script to check if someone has xxx permission see the export item and for who does not have xxx permission hide the item, we need exporting for some users and dont want to disable it, just want to hide it based on space permissions

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events