Edgewall Software

Changes between Initial Version and Version 1 of TracMultipleProjectsSVNAccess


Ignore:
Timestamp:
Feb 28, 2006, 4:20:48 AM (18 years ago)
Author:
Felix Collins
Comment:

Created page TracMultipleProjectsSVNAccess

Legend:

Unmodified
Added
Removed
Modified
  • TracMultipleProjectsSVNAccess

    v1 v1  
     1= How to control access to multiple projects using mod_authz_svn.so =
     2
     3This information applies to multiple project installs of Trac served through Apache. In principle the same information should apply to single project Tracs, but this hasn't been tested.  The examples come from a Windows environment but I can't see why a similar setup would not work elsewhere.
     4
     5It is convenient to keep all the access restrictions to a project in one place.  Trac already supports this for browsing of source code (see FineGrainedPermissions).  This page describes how to use the mod_authz_svn.so module to do this for the whole project. 
     6
     7A prerequisite for this being really convenient is that your repositories have the same names as your Trac projects. Something like:
     8{{{
     9C:/repos/project1 - for the repository
     10C:/trac/project1 - for the Trac project
     11}}}
     12mod_authz_svn.so will still work if you do not have this setup but you will have to add additional access restrictions in the SVN access file.
     13
     14The mod_authz_svn.so module simply takes a path, strips off the parent path and checks for a users access based on that stripped path, the users name and their access rights in the SVN access file.  It works stand alone from Subversion as a module in Apache so it may have other cunning uses, who knows...
     15
     16To get mod_authz_svn.so running it must be loaded in the Apache httpd.conf file.
     17
     18Example from httpd.conf:
     19{{{
     20LoadModule authz_svn_module modules/mod_authz_svn.so
     21}}}
     22
     23To activate it for the location that serves your Trac projects, the following must be inside that location.
     24
     25Example from httpd.conf:
     26{{{
     27  #Restrict access to Trac projects based on SVN access rights
     28  SVNParentPath D:/mytracprojects
     29  AuthzSVNAccessFile "C:/Program Files/Apache Group/Apache2/conf/svnaccessfile.txt"
     30}}}
     31
     32To get access to a Trac project the user must first pass any authentication you have in place.  They must then have access rights defined in the SVN access file.  If they have read only rights they will be able to view things in Trac but make no modifications.  If they have read and write they have the normal access. 
     33
     34The permissions system built into Trac comes into play once a user has authenticated, and had their access checked by   mod_authz_svn.so.  This means that any other permissions restrictions must still be defined in trac. 
     35
     36For more information on the SVN Access file see the [http://svnbook.red-bean.com/en/1.1/ch06s04.html Subversion Book]
     37
     38One other tip is for the situation where a user is read only on the repo but needs to create tickets in trac.  Simply create a section in the SVN access file for the newticket url.  Of course you must be careful that there is not actually a path in your repository that is called /newticket.
     39
     40Example from svn access file:
     41{{{
     42[project1:/newticket]
     43user1 = rw
     44}}}