info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to give certain users check in, everyone one else checkou t for


From: Mark D. Baushke
Subject: Re: How to give certain users check in, everyone one else checkou t for certain modules?
Date: Wed, 17 Dec 2003 15:16:44 -0800

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Peter Connolly <address@hidden> writes:

> > > What is the best method people have found to let only certain users
> > > check in and everyone else check out?
> > 
> > An example may be found in the contrib directory in the check_acls.in
> > script.
> > 
> > http://ccvs.cvshome.org/source/browse/ccvs/contrib/cvs_acls.in
> 
> The cvs_acls script says:
> 
> # 1. Put one line, as the *only* non-comment line, in your commitinfo file:
> 
> If we're already using commitinfo, commit_prep and log_accum to log
> and send email notifications, can this script co-exist?

Yes, you just need to wrap the multiple scripts into one script.

So, for example, you create a commitinfo like this:

ALL     $CVSROOT/CVSROOT/commitcheck

and have a commitcheck that looks something like the sample after my
.signature.

        Enjoy!
        -- Mark

           --------------- commitcheck sample ---------------
#! /bin/sh
########################################################################
#
# commitcheck - combine cvs_acls and commit_prep into one script for commitinfo
#
# Copyright (C) 2003, Mark D. Baushke <address@hidden>
# All rights reserved.
#
#  Permission is granted to copy and/or distribute this file, with or
#  without modifications, provided this notice is preserved.
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
########################################################################

#
# Does the access control list allow the user to have commit access?
#
if $CVSROOT/CVSROOT/cvs_acls ${1+"$@"}
then
    : # OK so far
else
    echo "Access control checks failed! (cvs_acls)" 1>&2
    exit 1 # tell cvs that there is a problem - abort the commit
fi

#
# Do the changes to the source files meet our standards?
#
if $CVSROOT/CVSROOT/commit_prep ${1+"$@"}
then
    : # OK so far
else
    echo "commit_prep failed!" 1>&2
    exit 1 # tell cvs that there is a problem - abort the commit
fi

exit 0  # Everything looks okay. Allow the commit
#          --------------- end commitcheck sample ---------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/4OPc3x41pRYZE/gRAtPvAJ41WCfL6abptPyNSrgK0RYhAPh3PgCdEjTA
fEyrm95n7x+JB9RCpu2Blc4=
=rRUH
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]