Is there a way to create new pages be restricted by default ?

gilad raz January 1, 2017

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

6 answers

1 accepted

1 vote
Answer accepted
Dmitry February 6, 2020

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>
ns ns November 6, 2020

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 ? 

5 votes
Thomas Burke July 28, 2020

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.

0 votes
Giacomo Esposito January 29, 2019

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

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 who suggested this strategy

Cattura.PNG

0 votes
Bill Bailey
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.
January 3, 2017

Other than creating your own plugin, you could use comalatech workflows 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.

0 votes
Milo Test
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.
January 2, 2017

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.

0 votes
jjgalea January 2, 2017

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 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events