views:

347

answers:

1

When a user is useing TortoiseSVN and RapidSVN, he sees the files as they are on the server, and thus has the ability to delete them. I want to prevent that. Maybe to block the option to delete?

Thanks, Oded

EDIT I want the only way a file will be deleted from a server is that a user deletes it from his local drive, and then commits it to the derver. I want to restric the ability of any user to delete directly from the server.

+1  A: 

Trying to prevent anything on the client side is, as always, inherently insecure. Your users could always use a different client.

So you need to manage the access rights on the server side (in the repository itself). Unfortunately, as far as I know, SVN natively supports only "read" and "write" access levels. Giving someone "write" access means that the user is not only able to modify existing files, but also to add new files and to delete existing ones.

You might be able to add this functionality via a pre-commit hook.

oggy
I'm familiar with the PRE-COMMIT hook, can you explain in detail?
Oded
If you're familiar with Python or Perl, you can try tweaking commit-access-control.pl and svnperms.py hooks from:http://subversion.tigris.org/tools_contrib.html#hook_scriptsOr try Google, you might find some pre-baked solutions.
oggy