The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Bulk change space permissions existing spaces

Dylan Moore
Contributor
March 18, 2024

BLUF (Bottom Line Up Front)

We have recently begun using dynamic groups synced from an external directory in confluence and jira, these groups are now being used for space permissions across confluence. As such I now need a way to bulk edit the space permissions for all of our existing spaces, both personal and communal. The most common change will be identifying spaces giving permission to the default "confluenceusers" group and instead give a new dynamic group (with a longer/more complex name) the same permissions. We have 100's of spaces so wanting to avoid doing 1 by 1.

(before anyone suggests not to do groups this way - its already happened and is a security request so just looking for solutions with our current set up :) )

 

Issues

  • New hires are no longer being added to our default group "confluenceusers" and are instead added to "dynamicgroup_xyz" (altered dynamic group name for security reasons)
    • This means they are not getting access to a lot of spaces by default - we are only finding out about these spaces when a new hire says they cant access a page.
  • There is no way to bulk edit all existing spaces
    • Criteria / behaviour would be simple:
      • IF space permissions contain group "confluenceusers"
      • THEN replace with group "dynamicgroup_xyz" - matching permissions previously given to 
      • Run this against all spaces in our confluence environment, when IF statement fails do nothing.
  • Will then look to replicate this automation for other groups in our environment.

 

Open to any suggestions of how to tackle this including via the API - while i don't possess the skills to do this change via the API i have a host of people that can lend a hand. 

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Marc -Devoteam-
Community Champion
March 19, 2024

Hi @Dylan Moore 

Space permissions can be set and removed via the API.

Not in bulk, you could write a script that contains all space keys and the use a variable to fill the API call for each space.

See API documentation: https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-space-permissions/#api-wiki-rest-api-space-spacekey-permission-post 

 

Dylan Moore
Contributor
March 19, 2024

Thanks @Marc -Devoteam- ! 

I'll discuss this solution with the team internally and will accept your answer once we've got it to work.

Like Marc -Devoteam- likes this
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events