I need to disable the creation button for specific spaces.
I found the code below that disables the creation button for all spaces. I need help adjusting it so I can still create pages in other spaces...
Any tips would be appreciated.
Hi @Guy Toyber
may I ask why you want to disable the creation button? How about using Confluence's space permissions in order to control who's able to create pages for specific pages in spaces? You can define per group or user who's able to do so. You could also restrict everyone from creating pages.
This way, you also prevent the creation of pages via the REST API.
Our Confluence is being migrated from Server to Data Center.
Before a space export we do restrict all users from editing. In this mode "edit" page is hide but "Create" page is visible.
Users can still create pages in other spaces, and since the create button is still visible the scenario of a user that will visit the limited space and will want to published a page there - it can happen - but the page will be published in another space.
In other words, the user intention will be to create a new page in the limited space but the result will be a new page in another space.
So to be on the safe side and to avoid confusion I would like to hide/disable the create button.
I understand, @Guy Toyber. Thank you for your explanation - that makes sense to me then. And I think I have a solution for you. This call
returns the current space key you are in. If you include that into an if statement into your code, you could check if the space key matches one of your moved ones.
Hope that helps,
Hi @Guy Toyber
See if the following page helps.
Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events