Can I set default page restrictions for all new pages within a space
Asked by Brad Sacks:

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.


Answers:
author: Marc Vila
body: Any progress on that?


author: Mark
body: 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!


author: Bruce Schlueter
body: 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.


author: Giacomo Esposito
body: 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](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 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>


author: Janiv Ratson
body: I need this feature. By default, all my new pages should be restricted.

Thanks


author: Jared Keebler
body: 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.


author: m-ryan
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.

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 :

```
&lt;script&gt;$.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) &gt; 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();});&lt;/script&gt;
```

comments: author: hjewell
body: 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.


author: Dmitry
body: 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>
```


author: Joey Castillo
body: 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.


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


author: Justin Cimino
body: 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


author: Bruno Rosa
body: 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,

comments: author: Brad Sacks
body: 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?


author: Arundas TC
body: 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.


Tags: cloud

confluence-cloud