Can I set default page restrictions for all new pages within a space

Brad Sacks
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 18, 2012

I want to have all new pages automatically be restricted. I don't want users to have to set the page to be restricted when they create a new page. I would prefer they have to remove the restriction if they want the page to be visible to others.

11 answers

4 votes
Marc Vila
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
April 1, 2014

Any progress on that?

3 votes
Mark December 9, 2012

As we need this feature too, I raised a feature request: https://jira.atlassian.com/browse/CONF-27498

I hope it will be implemented sooner or later...

Feel free to vote for it!

2 votes
Bruce Schlueter
Contributor
December 9, 2012

We also stand infront of this problem but I believe a simple way is that you use multiple spaces. In one you publish the pages that already have been approved and in the other you prepare the pages until they are approved. In that way you can give internal users access to public and internal information and with help of the space permissions you can easily restrict access.

1 vote
Giacomo Esposito January 29, 2019

Hi all, I just test 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 addon in this ticket: 
https://community.atlassian.com/t5/Confluence-questions/Is-there-a-way-to-create-new-pages-be-restricted-by-default/qaq-p/314372

1 vote
Janiv Ratson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 27, 2018

I need this feature. By default, all my new pages should be restricted.

Thanks

1 vote
Jared Keebler
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 10, 2016

Not having this feature available makes users less likely to use the product for fear of exposing items prematurely. Control of content privacy is a huge issue and continually ignored by tech companies for some reason. 

1 vote
m-ryan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 28, 2015

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.

My requirement was to restrict new pages to the author of the page by default and prompt him with the page restrictions dialog so that he's forced to "white list" the page to the relevant groups.

To implement this, I added the following code at the end of the HEAD in the CUSTOM HTML configuration section : 

<script>
$.waitForElement = function (elementID, thresh) {
        var d = $.Deferred(),
            start = +new Date(),
            threshold = thresh || 1000,
            _document = document,
            _setTimeout = setTimeout;
        function pollElement() {
            var element = _document.getElementById(elementID);
            if (checkTime(d)) {
                if (element) {
                    if (!$(element).is(':visible')) {
                        _setTimeout(pollElement, 0);
                    } else {
                        d.resolve(element);
                    }
                } else {
                    _setTimeout(pollElement, 0);
                }
            }
        }
        function checkTime(d) {
            if ( ((+new Date()) - start) > threshold ) {
                d.reject();
                return false;
            } else {
                return true;
            }
        }
        pollElement();
        return d.promise();
    };
 
function restrictToMe(){
    $('#rte-button-restrictions').click();
    $.waitForElement('page-permissions-choose-me',5000).done(function(){
        $('#page-permissions-choose-me').click();
        $.waitForElement('remove-permission-0',5000).done(function(){
            $('#restrictEditRadio').click();   
            $('#page-permissions-choose-me').click();
        });
    });
}
 
$(function(){restrictToMe();});
</script>
hjewell
Contributor
December 31, 2018

Has anyone tried this code? Does it still work? I'm looking for a solution to this issue too. I'm surprised that there isn't an option to automatically apply the restriction to all newly created pages in a space. 

Dmitry February 6, 2020

It doesn't work. 

You can try another:

<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>

 

1 vote
Joey Castillo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 14, 2013

We could really use this as a feature too. It's a bit of hassle to move pages from space to space. We are a small team. Would love to be able to have all new pages have a default permission, then lift it when ready to show the world.

0 votes
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>
0 votes
Justin Cimino April 16, 2018

Hi Everyone. 

Is this issue dead? (e.g., https://jira.atlassian.com/browse/CONFSERVER-27498)

My goal is to have open spaces viewable by the standard confluence user in our company. Then, I would like a restricted (closed) team space (e.g., executive team) whereby all created pages within that space are restricted to that team. I want to avoid an executive creating a page within the executive team space that he/she forgets to set to restricted (e.g., salaries) and is therefore accessible to the entire company. 

Thank you,

Justin

0 votes
Bruno Rosa
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 19, 2012

Hi, I don't think is possible to make the new pages somehow 'restricted' by default, unless you have restricted the space too (which contains the pages you want to restrict), thus all the pages created will be created respecting the restriction of the father (space).

Hope it helps.

Cheers,

Brad Sacks
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 19, 2012

Ok, makes sense, thanks for the response.

I guess I'm looking for the following:

1.) I want to use confluence to create public content.

2.) I want to have content authors have the ability to create and edit pages, but no publish them to be viewable by annonymous users.

3.) After a simple review process I want to be able to make pages viewable to annonymous users individually on a page by page basis.

Is this possible with Confluence?

Arundas TC
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 27, 2017

We need this. Space Permissions are a complex mess.

There should be a simple way to set the "Default" permission for any newly created page in a space.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events