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

Reg: Restrict on svn delete.

From: jeya prakash <sv.jeyaprakash_at_gmail.com>
Date: Thu, 22 May 2008 16:39:25 +0530

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).

with regards,
Jeyaprakash S
Received on 2008-05-22 18:49:06 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.