[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Restriction on deletion of files from Subversion

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-06-20 12:22:39 CEST

On Jun 20, 2007, at 05:03, <maitrayee.bhowmick@wipro.com>
<maitrayee.bhowmick@wipro.com> wrote:

> Can you please help me?? I want to restrict the deletion of files from
> our Subversion so that only Admin can delete files.We are currenly
> working with a team where most of the team mates are not very familiar
> with the system and most of the time they are deleting the files
> unintentionally.Its very important for me to stop them from doing
> this.I
> have to give them write access as they are working on those
> files.Please
> give me a solution and tell me how to modify the hook files for this.I
> am not at all familiar with the Hook files in Subversion.

I believe you can use the "svnperms.py" Python script for this. You
call the script from the pre-commit hook. The script is included in
the Subversion source distribution and comes with an example
configuration file. I can't provide more help than that because I
haven't used it myself.

You could also write your own pre-commit script. The logic would be
along the lines of:

- Get the list of items changed by running "svnlook changed $REPOS -t
$TXN"
- If any line begins with the letter D (for Delete), print something
to stderr and exit with a nonzero code

Oh yes, and:

- Do this only if the user isn't one of your designated admins. You
can see who the user is by running "svnlook propget --revprop $REPOS -
t $TXN svn:author"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Jun 20 12:23:24 2007

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.