This is cloned from
BSERV-3839 , because I have the same issue and I feel this was not properrly addressed at the time and this is still a current issue with Bitbucket 5.x.
There was a comment in the original ticket that argued this issue was the same as
STASH-3406, which is clearly NOT the case. The latter ticket deals with permission to create repositories in other projects, whereas this ticket deals with permission to delete repositories in a project.
I would therefore be grateful if you would please review carefully the description of the original ticket below:
TL;DR allow me to enable a flag "disallow repository deletion"
When I try to delete a repository I get the following message
This cannot be undone. All of the repository's contents will be irretrievably lost if they are not also stored elsewhere. All pull requests to this repository will also be deleted.
This sounds dangerous and something that you don't want many people to be able to do.
At the same time we want to allow a user to create new repositories.
The closest thing I can see is to grant the PROJECT_CREATE permission but not the PROJECT_ADMIN permission. When I tried that it turned out that they automatically get the PROJECT_ADMIN permission on a repository that they just created (and thus permission to delete the repository).
Please allow an option to prevent a user from having permission to delete a repository.
An option to globally disallow repositories from being deleted would also work.
Looking forward to your answer on this issue,
With best regards.