Change text in the restriction pop up
Asked by Dominic Lagger:

Hi all

Is there any possibility (JS, ScriptRunner, other ideas) to change the text in the restriction pop up?

![image.png](/t5/image/serverpage/image-id/140902i9B6732057860DB82/image-size/large?v=v2&px=999 "image.png")

Use Case: A lot of user doesn't understand, that the edit restriction isn't the edit permission. So they ask, why the user do not have edit permission although they "give them permission".

Thanks for any idea!

Regards, Dominic


Answers:
author: Thiago Masutti
body: Hi Dominic.

The following JavaScript might help to get you started with the goal, which you can append to the Custom HTML admin section.

```
<script type="text/javascript">
$( document ).ajaxSuccess(function( event, request, settings ) {
if (settings.url.indexOf("getcontentpermissions.action") >= 0 && (event.currentTarget.URL.indexOf("viewpage.action") >= 0 || event.currentTarget.URL.indexOf("/display/") >= 0)){
console.log("ajaxSuccess",settings.url, event.currentTarget.URL);
if ($('span.page-restrictions-dialog-explanation').html().indexOf("Everyone can view and edit this page") >= 0){
$('span.page-restrictions-dialog-explanation').html('Your custom text');
}

}
});
</script>
```

This script does:

* Listen to XHR successful load events, which in this case is the user opening the *Restrictions* popup.
  * Subsequent code is only executed if the XHR event came from the view page.
* If the current text is "Everyone can view and edit this page", then it changes to "Your custom text".

I just couldn't find a way to bind it to changes on the selector.  
So if the user changes from *No restrictions* to something else and then gets back to *No restrictions*, then the original text would be used.

Kind regards,  
Thiago Masutti

comments: author: Dominic Lagger
body: Hey [@Thiago Masutti](/t5/user/viewprofilepage/user-id/1209618)

Thanks a lot for your help!

It's pitty, that you couldn't find a way to bind the selector changes. Because I want to show a message only in the "Only some people can view or edit"-Case.

Because then, the user thinks "Oh I gave him edit permissions", and then a support ticket could be avoid when the text would be "Only some people can view or edit. Make sure to give edit permission on the space" (Something like that)

Regards, Dominic


author: Thiago Masutti
body: I see [@Dominic Lagger](/t5/user/viewprofilepage/user-id/601600)

If editing a bundled plugin is an option to you, which would also require you to make modifications on every upgrade, then you can change the original plugin and the related file in the translation plugins for target languages.

* confluence-page-restrictions-dialog-\<*version* \>.jar
  * page-restrictions-dialog.properties
* confluence-language-pack-\<*language* \>-\<*version* \>.jar
  * page-restrictions-dialog\<*language*\>.properties

The jar files are located in \<*confluence-install*\>/confluence/WEB-INF/atlassian-bundled-plugins

These may be the target options:

```

option.edit.description=Everyone can view, only some can edit.
option.none.description=Everyone can view and edit this page.
option.viewedit.description=Only some people can view or edit.
```

Changing these files requires a restart and clearing the plugins cache is recommended.  
If using data center, this should be changed on all nodes of the cluster.

Kind regards,  
Thiago Masutti


author: Thomas Deiler
body: Dear [@Dominic Lagger](/t5/user/viewprofilepage/user-id/601600) ,

removed my answer. The one of [@Thiago Masutti](/t5/user/viewprofilepage/user-id/1209618) is the best! Please accept that one.

So long

Thomas


Tags: confluence-server

server