Is there a way to create new pages be restricted by default ?
Asked by gilad raz:

configure confluence so that creating new page will be restricted by default


Answers:
author: Dmitry
body: Hello,

It's a pretty hackish solution, but you can do it using CUSTOM HTML and play around with javascript. Of course you may have to update this code if you don't use the default theme or if confluence changes it's default layout.

```
<script> 
AJS.toInit(function() {
if (AJS.params.formName === "createpageform" ) 
AJS.$.post(
AJS.params.baseUrl + '/pages/setcontentpermissions.action',
{viewPermissionsUsers:AJS.params.remoteUserKey, editPermissionsUsers:AJS.params.remoteUserKey, viewPermissionsGroups:"", editPermissionsGroups:"", contentId: AJS.params.contentId, atl_token:AJS.params.atlToken},
function() {}
);
});
</script>
```

comments: author: ns ns
body: Hi Dmitry,

i couldnt get this to work , i have added this in the HTML macro in a template, so whenever a page is created from template it should change the restrictions automatically , but somehow missing something. do we have to change the baseUrl ?


author: Thomas Burke
body: The simple answer is no. There is no native way to do this. instead, you have to hack a nonscalable solution or pay over 2K ( for 100 users) for a plugin to accomplish something that from best security practice should be native design.


author: Giacomo Esposito
body: Hi all, I just tested a complete solution and it works as expected, so any new page is created with custom restriction, in my case only the author can see and edit.

The solution is possible thanks to an addon, "Comala Workflow"   
[https://marketplace.atlassian.com/apps/142/comala-workflows?hosting=server\&tab=overview](https://marketplace.atlassian.com/apps/142/comala-workflows?hosting=server&tab=overview)

Thanks to this addon is possible to create a simple workflow with just one state (I called PRIVATE) where is possible to create a trigger to add a restriction on page creation. Herebelow the advanced configuration to set at the workflow level

{workflow:name=Restrictions}  
{description}  
PRIVATE: only author can view and edit  
{description}  
{state:Private\|colour=#FFAB00}  
{state}  
{trigger:pagecreated}  
{add-restriction:type=view\|user=@creator}  
{trigger}  
{workflow}

**Thanks to [@Bill Bailey](/t5/user/viewprofilepage/user-id/502089) who suggested this strategy**

![Cattura.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/43897i01DA4FE59E4D4746/image-size/large?v=v2&px=999 "Cattura.PNG")


author: Bill Bailey
body: Other than creating your own plugin, you could use [comalatech workflows](https://marketplace.atlassian.com/plugins/com.comalatech.workflow/server/overview) to construct a workflow that triggers on page creation which can set editing and view restrictions. It could also be used to send an email to an admin. Of course, you could build a more complex workflow with it.

I have written some complex doc processes using this plugin, having it set page permissions at various states, depending upon a set of conditions. So entirely doable.


author: Milo Test
body: By default all new pages are unrestricted, but take on the restrictions of their parent page and the permissions of the space.

There is no way to set restrictions when either the Create or create from template buttons are used. You can use an add-on to create pages with a specific restriction, but the the user will have to click a button or link that the add-on generates.


author: jjgalea
body: Hi,  

You need to make sure users are added into groups that do not allow them to have such access.

Users might not have permission individually but might be a member of a specific group that has permissions to create pages.

Also when creating a space on confluence, Take a look in Browse \> Space Admin \> Permissions and make sure when creating the space, only the person who created it can only have full admin rights

Cheers,  
Jason


Tags: confluence-administration