Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Bulk edit Confluence space permissions

Hello All,

We have number of spaces created and when we check space admins we get conflunece admin names with space admin.As confluence admins are one who created it.

In global permisions we have found confluence admins has space admin rights due to which we can see them. But now we planned to remove space admin rights after creating and assigning a space admin.

But question is how to change or remove or edit bulk space permissions? 

4 answers

1 vote
Alexey Matveev
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.
Oct 17, 2018

Hello,

You could also use the Power Scripts for Confluence add-on:

https://marketplace.atlassian.com/apps/1219507/power-scripts-for-confluence?hosting=server&tab=overview

It is a free add-on. I've found Power Scripts for Confluence really handy for Confluence admins who want to automate their work and apply bulk actions to Confluence.

You could use the addGroupToSpacePermission method to change permissions of a space.

Hi Alexey,

 

Do you have a snippet for this already or a repository where we keep "common power scripts"?

 

My use case is similar:

For all spaces (getAllSpaces), check if group has "confluence-users" as a group (using groupExists or groupHasSpacePermission) and if it does then apply "new-group" to that space (addGroupToSpacePermission).

 

I foresee similar situation for removing groups (removeGroupFromSpacePermission). 

Spoke with the power-scripts folks. Below is a snippet that we created in order to solve that need.

Note: If you want to see the logs make sure you follow these steps (you may need to add the logger to your logging and profile section)

string loglevel = "INFO";
logPrint(loglevel, "Starting Modification of group space permissions");
date startTime = currentDate();
logPrint(loglevel, startTime);

string [] spaces = getAllSpaces();

string [] newPermissions;
string newGroup = "change-me";
string oldGroup = "change-me";

// Check if the group exists
if (groupExists(newGroup)) {
// iterate through all spaces
for(string space in spaces) {

logPrint(loglevel, "Checking this space " + space);

// Does it have the group we want to mimic?
string [] permissions = groupSpacePermissions(space, oldGroup);

logPrint(loglevel, "Permissions for space " + permissions);

if(size(permissions) > 0) {
// add all the same permissions for the new group
for(string perm in permissions) {
// I think there is a bug about EXPORTPAGE so exclude it for now
if (isNotNull(perm) and perm != "EXPORTPAGE") {
// add the new group
addGroupToSpacePermission(perm, space, newGroup);
// we may want to remove the old group permissions
// untested but a fast way to do it would be to remove the VIEWSPACE
// if that is the case you can remove it out of this for loop all together
// removeGroupFromSpacePermission(perm, space, oldGroup);
}
}
// get the permissions
newPermissions = groupSpacePermissions(space, newGroup);

logPrint(loglevel, "Successfully added " + newGroup + " to space " + space + " with these permissions " + newPermissions);
} else {
logPrint(loglevel, "Not adding " + newGroup + " to this space " + space);
}
logPrint(loglevel, "end of space modification for " + space + " -------------------------");
// I used this break to just test the modification of one space before site-wide
// break;
}
}

logPrint(loglevel, "Finished running SIL for space group permission modification");
date endTime = currentDate();
logPrint(loglevel, endTime);
Like # people like this

Hi there!

If anyone is still searching for a solution on how to manage multiple space and page permissions without scripting in Confluence here it is!

We just released our new app “Permission Management for Confluence”.

So feel free to give it a try and let us now, if you like it or what you need.

Best regards

Stella

Hi @Stella Schneider , do you have a Cloud equivalent? 

Hi @Joel Andrews

thanks a lot for your interest in our app!

We are currently developing the cloud version and are hoping to release it soon!

I will let you know as soon as it is online.

 

Best regards

Stella

Hi @Alexey Matveev and @DORIAN KERSCH 

 

is there a version for Confluence cloud available ? we use power scripts add-on for jira. but need for confluence as well, as problems with spaces having wrong user groups added is very important and the ability to edit them in bulk would be awesome. 

thanks 

0 votes
Marcelo Horlle
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 12, 2017

Hey Ehteshamuddin,

There is no way of doing that through the UI, but we have some options to run this exercise through Command Line. They have been already been shared by a colleague on another question. You might want to take a look on it, I think it will help you out! Check it out here.

Hope it helps, have a great week ahead!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events