Version Control with Subversion - svnserve, a custom server - Set access controls
Set access controls
There are two more variables to set in the
svnserve.conf file: they determine what
unauthenticated (anonymous) and authenticated users are
allowed to do. The variables anon-access
and auth-access can be set to the values
none , read , or
write . Setting the value to
none restricts all access of any kind;
read allows read-only access to the
repository, and write allows complete
read/write access to the repository. For example:
[general]
password-db = userfile
realm = example realm
# anonymous users can only read the repository
anon-access = read
# authenticated users can both read and write
auth-access = write
The example settings are, in fact, the default values of
the variables, should you forget to define them. If you
want to be even more conservative, you can block anonymous
access completely:
[general]
password-db = userfile
realm = example realm
# anonymous users aren't allowed
anon-access = none
# authenticated users can both read and write
auth-access = write
Notice that
svnserve
only understands
“blanket” access control. A user either has
universal read/write access, universal read access, or no
access. There is no detailed control over access to
specific paths within the repository. For many projects and
sites, this level of access control is more than adequate.
However, if you need per-directory access control, you'll
need to use either use Apache with
mod_authz_svn
(see
the section called “Per-Directory Access Control”) or use a
pre-commit
hook script to control write
access (see
the section called “Hook Scripts”). The
Subversion distribution comes with
commit-access-control.pl
and the more
sophisticated
svnperms.py
scripts for use
in pre-commit scripts.
[an error occurred while processing this directive]
|