Hook to make Subversion available to specific users only.

We have an existing Subversion repository that uses LDAP to manage users / passwords. There are some new users whom we would like to provide read-only access to SVN. I did some Google searches and found a way to provide read-only access to anonymous users, but that’s not what we want. We do not want to open SVN to everyone. We still want to control login through LDAP, but we would like to prevent some named users from adding / editing / deleting.

I assume this can be done with a hook (pre-commit?), But I have no experience writing hooks. Can someone show me or show me an example of how to do this?

+3
source share
1 answer

I am using an LDAP setup with a configuration similar to:

to / Etc. / apache2 / sites with support / MySite

<Location /svn>
  DAV svn
  SVNParentPath /var/svn
  SVNListParentPath on
  AuthBasicProvider ldap
  AuthType Basic
  AuthzLDAPAuthoritative Off
  AuthzSVNAccessFile "/var/svn/conf/svnaccess.conf"
  AuthName "My SVN"
  AuthLDAPBindDN "....."
  AuthLDAPBindPassword "....."
  AuthLDAPURL "....."
  Require valid-user
</Location>

/var/svn/conf/svnaccess.conf

[groups]
readonly = user1, user2

[/]
*=rw
@readonly=r
+3
source

Source: https://habr.com/ru/post/1742862/


All Articles