Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to disable anonymous access to all personal spaces in one time

zhou hu May 23, 2012

We have enabled anonymous access on site level to allow anonymous user to access to a public space which is anonymous access enabled. Then we find many people post contents, such as blog, on their personal space which is anonymous access enabled. But we don't want the anonymous users to access such contents on people's personal spaces. So is there any way to disable anonymous access to all the personal spaces in one time?

2 answers

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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.
May 23, 2012

Use the Confluence Command Line Interface with the runFromSql action with SQL to select all personal spaces for the removePermissions action - something like:

confluence --action runFromSql --sql "select spacekey as "space" from spaces where spacetype = 'personal'" --common "-a addPermissions --permissions view --userId anonymous" --database confluence-3.5.13 --driver postgresql

This is a legal Confluence activity, no need to shutdown Confluence or worry about database backup. Use the latest snapshot - confluence-cli-2.6.0-SNAPSHOT-distribution.zip

Eric Sebian May 2, 2019

Is this still a valid option for removing anonymous access permissions? If I go this route, will I need to run this periodically or does it also turn off the functionality? 

0 votes
Septa Cahyadiputra
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.
May 23, 2012

Hi there,

Highly recommend you to create a database backup dump and execute the given SQL query below on your staging environment as a safety precaution

DELETE FROM spacepermissions WHERE spaceid IN (SELECT spaceid FROM SPACES WHERE SPACETYPE ='personal') AND PERMGROUPNAME IS NULL AND PERMUSERNAME IS NULL;

The above query will delete every anonymous permission on every personal spaces. Hope it helps.

Cheers,

Septa Cahyadiputra

Eric Sebian May 2, 2019

Hi Septa. Will this account for any future spaces created? Meaning, with the option for anonymous access be revoked? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events