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

Re: Reg: Restrict on svn delete.

From: Andy Levy <andy.levy_at_gmail.com>
Date: Thu, 22 May 2008 12:51:58 -0400

On Thu, May 22, 2008 at 7:09 AM, jeya prakash <sv.jeyaprakash_at_gmail.com> wrote:
> Hi All,
>
> I am working in the SVN administration part. I would like to restrict svn
> delete for some users. Is there any way to restrict the same.
>
> and i tried the same with my own script in start-commit hook. refer below:
> =====================================
> start-commit hook:
>
> #!/bin/sh
>
> REPOS="$1"
> USER="$2"
>
> /usr/bin/perl /data/svntree/scm_test/hooks/test_hooks.pl $USER 1>&2
>
> if [ $? -eq 1 ]
> then
> echo "\nYou are not having the rights to delete the files!\nPlease
> contact your admin to delete the files!\nCommit aborted!" 1>&2
> exit 1
> else
> exit 0
> fi
> ========================================
>
> My script: test_hooks.pl
>
>
> #!/usr/bin/perl
> my $uname=$ARGV[0];
> my $i=0, $j=0;
> my @DEL_FILE;
>
> my $SVN_STATUS='/usr/bin/svn status $PWD';
> @arrayt1=`exec $SVN_STATUS`;
> if ($uname eq 'Mani')
> {
> exit 0;
> }
> else
> {
> foreach my $line (@arrayt1)
> {
>
> chomp($line);
> my @array1=split(/ /,$line);
> if ( $array1[0] eq 'D' )
> {
> $DEL_FILE[$i]=$array1[1];
> $i++;
> }
>
> }
>
> if ($i ne '0')
> {
> print "Deleted Files\t:\n";
> while ("$j" <= "$i")
> {
> print "$DEL_FILE[$j]\n";
> $j++;
> }
> exit 1;
> }
> else
> {
> exit 0;
> }
> }
> ====================================
>
> seems to be that the hook is running in the server. not for the local
> repository. but my pre-commit (checking log message) hook is working good.
> Please tell me is there any way to do the same(restrict svn delete).

Hook scripts only run on the server. You cannot restrict someone from
deleting items from their working copy.

Have you looked at svnperms.py? I think it already implements delete
permission controls.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-05-22 18:52:20 CEST

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.