I want to get all anonymous spaces in my Confluence instance through a SQL query, however I couldn't find a decent query. I have this which returns the permissions on (all) spaces, but not the anonymous ones:
SELECT sp.permid, sp.permtype, s.spacekey, s.spacename, sp.permgroupname, um.lower_username FROM SPACEPERMISSIONS sp JOIN SPACES s ON sp.spaceid = s.spaceid LEFT JOIN user_mapping um ON sp.permusername = um.user_key
i have tried with where sp.permgroupname IS NULL, but that doesn't work.
Any help or pointers in the right direction?
This might work:
SELECT * FROM spacepermissions WHERE COALESCE(permgroupname, '') = '' and COALESCE(permusername, '') = '';
I got the information from this page: http://stackoverflow.com/questions/14172978/postgresql-select-empty-fields
If I understood you correctly, you would like to retrieve spaces which anonymous users can access correct?
This query should return all spaces which anonymous can see and access:
select distinct s.spacename from spaces s join spacepermissions sp on s.spaceid = sp.spaceid where sp.permtype = 'VIEWSPACE' or 'EDITSPACE' and permgroupname is null and permusername is null;
The anonymous permissions are stored with the permgroupname and permusername as null.
I hope this helps!
Just as a hint for Oracle users, here you can use following
select distinct s.spacename from spaces s join spacepermissions sp on s.spaceid = sp.spaceid where sp.permtype in ('VIEWSPACE','EDITSPACE') and permgroupname is null and permusername is null;
Atlassian Summit is an excellent opportunity for in-person support, training, and networking.Learn more
Atlassian market place contains number of Apps/Addons which improves the capability of out of the box Atlassian products. It is good to follow a plugin evaluation process before install add-ons. So t...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs