Hi,
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...
<script type="text/javascript">
AJS.toInit(function(){
AJS.$('#quick-create-page-button').hide();
});
</script>
Any tips would be appreciated.
Thanks!
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.
Cheers,
Matthias.
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.
Regards,
Guy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
AJS.Meta.get("space-key")
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,
Matthias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I appreciate your help so far, would you mind to paste the entire code? It did not work for me...
Additionally, If I would like to hide another create button on additional space, how it will work?
Regards,
Guy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thiago,
Thanks for the info, its now working perfect!
I appreciate your help!
Regards,
Guy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Thiago Masutti / Matthias Gaiser _K15
Can anyone help me? We are migrating from Confluence, and after migrating, we are removing permissions to some spaces, like 100 at once. Is there any script via script runner or custom HTML Java script that can help me remove permissions to some of the selective spaces?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.