In our Environment we mange the Space permissions not from within Confluence.
Permissions are managed in a central component and are updated in Confluence using a REST API.
We don't want that Space Admins can change permissions in Confluence directly.
Question: Is there a possibility to make the Space Permission Page read-only?
(/confluence/spaces/spacepermissions.action?key=<spacekey>)
Regards, Andy
@Andreas von EuwI suppose you are managing permission via rest API, here is a script that will globally hide permission tables and possibility to "Edit"
Please note that this Just hide the tables and buttons, but does no harm to permissions it self.
Add to Custom HTML " At end of the HEAD" once log in as confluence administrator
<script>
AJS.toInit(function(){
AJS.$('#gPermissionsTable').hide();
AJS.$('#uPermissionsTable').hide();
AJS.$('#aPermissionsTable').hide();
AJS.$(".buttons-container").hide();
});
</script>
Best!
@Moses Thomas: Thanks a lot. This does really look okay for now. We only hide the buttons-container, because we would like to see the current permissions.
But a last question, is this .buttons-container only used on the permission page? Or do we hide buttons on other pages as well now?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andreas von EuwOnly on the permission page, other buttons will not be affected.
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.
You are welcome!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Moses Thomas: Found another button that got hidden because of the custom html:
The attach button on the attachment page has gone.
So, we should limit this to the permission page only . how can we achieve this, any idea :-) ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andreas von EuwOfcourse we could do it by modifying script, but please could you show me via screen shot which button is missing ?
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.
this is the html with the div buttons-container:
<div class="buttons-container">
<div class="buttons">
<input name="confirm" class="submit aui-button " id="edit" type="submit" value="Attach">
</div>
</div>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andreas von EuwNice one :D for spotting it, and interesting now we will have to deal with this case, the value "attach " is the first element in the container i did some test with slice() and remove()/hide()(almost same method) , i notice that when i leave the slice of the first element they both appear in both screen. so we need to have an if condition when we are in the attachment screen we do nothing :). i will give you feed back soon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Moses,
I've found the correct jquery to disable my edit permission button on the space permission page only:
<!-- to disable edit permission button on space permission page -->
<script>
AJS.toInit(function(){
AJS.$('form[name="editspacepermissions"]').hide();
});
</script>
Thanks for showing me the right way to solve this.
Regards, Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andreas von EuwGreat! this is another solution, so lets replace hide() with remove(); so that some one will not make some nasty move in the developer view.
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,
Just a quick note about the script
<script>
AJS.toInit(function(){
AJS.$('#gPermissionsTable').hide();
AJS.$('#uPermissionsTable').hide();
AJS.$('#aPermissionsTable').hide();
AJS.$(".buttons-container").hide();
});
</script>
If you use hide() the elements still reside in the dom tree. You should remove or detach them to really get rid of them.
Furthermore you should consider to add a custom plugin defining a servlet filter which redirects from the actions or blocks at least the save operation.
Best,
Tobias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have already mentioned to replace hide() with remove() and this solution is buggy, because the class is used in the add attachment screen.
class="buttons-container"
This is the easy solution for this request
<script>
AJS.toInit(function(){
AJS.$('form[name="editspacepermissions"]').remove();
});
</script>
best!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andreas von Euw - How do you edit the permission of the space using the API. trying to form a curl syntax for the page, https://confluence.sd.apple.com/spaces/editspacepermissions.action?key=<key> ... Mind posting an example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As Confluence do not provide a REST API to do this we've created our own Confluence Add-On to provide additional REST methods to edit space permissions remotely.
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.
@Andreas von EuwPlease see articles below
Best!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Moses,
Thanks for the quick answer. But this doesn't solve my Problem.
It's not done by removing the Space "admin" permission from all users. We need still users with Space admin permission.
From the Space Permission docu the admin permission is relevant:
"Admin gives you permission to access all space administration tools, including things like permissions, templates, look and feel, and the ability to delete the whole space. "
We just want to remove the ability to edit permissions. But all the other tools like templates, export, look and feel should still be available to the Space Admins.
Regards, Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andreas von EuwEvery thing you need is there, but let me explain, if you want to remove Edit for the whole space, go to space tool > permission > edit permission and make the the "add" red that is you unchecked this permission for any group/user
Best!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Moses ThomasDon't understand your answer. I know the Space Tools quite well. What do you mean with "make the the 'add' red" ? What permission are you exactly talking about?
But anyway. There is nothing to uncheck on this Screen that would solve my Problem ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andreas von EuwAhh Andrew i guess i miss understood your question you don't want space admin to change permission i suppose you want to hide this possibility then you will need a script or a work around is Just to set only one space admin, infact there has to be a space admin.
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.