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: 

How to prevent a Space Administrator from delete their Space?

Bill Brinkley
January 19, 2021

How do you configure Confluence to prevent a Space Administrator from deleting their Space. We want to make this a Confluence Administrator task. We are having to restore Spaces that were deleted and then needed by the Space users. Thanks,

4 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Thiago Masutti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 20, 2021

Hi @Bill Brinkley .

This is really not something you could configure on Confluence out-of-the-box.

If you need to give Space Deletion permissions only to Confluence Administrators, then you are able to do that by applying non-standard customization to your Confluence.

The contents of the <confluence-install>/confluence/spaces/removespace.vm file controls the appearance of the Delete Space feature in the UI.
This is how it looks when using the default contents for that file.

space-delete-1.png


You could customize it in a way that only Confluence Administrators would be able to see this information and, therefore, delete the Space.
Other users, such as Space Administrators, would see something as the sample below.

space-delete-2.png

 


If this is something that is valuable to you, you could use the following content on the <confluence-install>/confluence/spaces/removespace.vm file.

<html>
<head>
<title>$action.getText("title.remove.space")</title>
</head>

#applyDecorator("root")
#decoratorParam("helper" $action.helper)
#decoratorParam("context" "space-administration")
#decoratorParam("mode" "view-space-administration")

<body>
#applyDecorator ("root")
#decoratorParam ("context" "spaceadminpanel")
#decoratorParam ("selection" "removespace")
#decoratorParam ("title" "$action.getText('title.remove.space')")
#decoratorParam ("selectedTab" "admin")
#decoratorParam ("selectedSpaceToolsWebItem", "removespace")
#decoratorParam("helper" $action.helper)

#if( $permissionHelper.isConfluenceAdministrator($remoteUser) )

#applyDecorator ("confirm")

<p>$action.getText("remove.space.desc")</p>
#if( $action.showLargeQueueWarning)
#applyDecorator("message" "$action.getText('info.word')")
#decoratorParam("type" "info")
$action.getText("com.atlassian.confluence.spaces.actions.RemoveSpaceAction.warn.large.indexqueue", [$action.indexQueueSize])
#end
#end
#applyDecorator ("message" "$action.getText('warning.word')")
#decoratorParam("type" "warning")
$action.getText('removespace.operation.cannot.be.undone')
#end

#decoratorParam ("formAction" "doremovespace.action?key=$htmlUtil.urlEncode($space.key)")
#decoratorParam ("formName" "removespaceform")

$action.getText("alert.remove.space", [$htmlUtil.htmlEncodeAndReplaceSpaces($space.key), $webwork.htmlEncode($space.name)])
#end

#else

#applyDecorator ("message" "$action.getText('warning.word')")
#decoratorParam("type" "warning")
<p>You don't have permission to delete this Space.</br>Please contact your Confluence administrator.</p>
#end

#end

#end

</body>

#end
</html>


You don't need to restart Confluence after making changes to this file.
You would also need to check this file after every upgrade to see if the same modifications would still be valid and reapply them.

 

Let us know if that works to you.

Kind regards,
Thiago Masutti

0 votes
Chris S_
May 8, 2025

Fyi, it it helps ... recently upgraded from DC 8.5.15 to DC 9.2.3.  The customized removespace.vm solution above worked before the upgrade.  After the upgrade Confluence did not recognize confluence-administrators anymore, hence could not delete a space.

Our fix: replace: 

#if( $permissionHelper.isConfluenceAdministrator($remoteUser) )


with this: 

#if( $permissionHelper.isConfluenceAdministrator($authenticatedUser) )

and this solved the issue.

0 votes
KAGITHALA BABU ANVESH
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 Champions.
January 19, 2021

Hi @Bill Brinkley ,

I think we can't restrict space admin for deleting space from instance.

Please check the below link

 

https://support.atlassian.com/confluence-cloud/docs/delete-a-space/ 

0 votes
Tansu Akdeniz
Community Champion
January 19, 2021

Hi @Bill Brinkley 

If you give space admin permission, they can delete it. 

There is an open ticket for it. Please watch and vote it.

Best

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

DEPLOYMENT TYPE
SERVER
VERSION
7.4.3
TAGS
AUG Leaders

Atlassian Community Events