Question

There are some new consultants, who shall be working on parts of a software which aren't functionally critical to the overall software. The software is not organized in a modular fashion, s.t. all of these source-files that hold the non-critical functionality, are not isolated in a directory.

Is there a way such that, the consultants are not able to fork/branch the project, and also can work only on files (the non critical functionality files) ?

The version-control software is SVN in this case.

Was it helpful?

Solution

If you use VisualSVN Server on Windows you can easily set access (eg read-only or no-access) permissions on the directories. You cannot set anything on a per-file basis in SVN (it was designed to operate on directories). Other SVN systems can do the same by editing the authz file and editing an entry for each directory you want protected.

Setting access controls on individual files will quickly become a nightmare, so move the files you want protecting into a couple of directories and put your controls on them.

OTHER TIPS

You could do this by doing the following:

  1. Move the source files with non-critical functionality to another location in the repository - I'd suggest at a folder level the same as the trunk.
  2. Set up the permissions for the consultants to have read-only access to the existing repository and read / write access to the new directory created in step 1
  3. Add an SVN:Externals for the files you moved in step 1. As from SVN 1.6 you can have individual file externals

Make sure you give your consultants read-only access to the trunk and read-write access to the new directory

Step 3 is the tricky bit so I'll attempt to explain further. Say your original repository has a file structure like this

/trunk
  /lib 
    - Non Critical File 1.txt
    - Non Critical File 2.txt
    - Other files.h

After you have completed step 3 your repository would look something like this:

/trunk 
  /lib
    - SVN: External to Non Critical File 1.txt 
    - SVN: External to Non Critical File 2.txt 
    - Other files.h
/NewDirectory
  - Non Critical File 1.txt
  - Non Critical File 2.txt

Do this for each of the non-critical files.

This will allow your consultants to only view the files in the existing repository, but only update the files in the newly created directory

To set up SVN:Externals see this stack overflow post

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top