Win Unix Mac

Articles,How Tos,Tips n more

  • Increase font size
  • Default font size
  • Decrease font size

Subversion - How to restrict certain users to read only or read write permissions - Part 2

E-mail Print PDF
Article Index
Subversion - How to restrict certain users to read only or read write permissions
Part 2
All Pages

Next , now that the software is installed, we are going to create a directory under /home for our Subversion repo, then use the svnadmin tool to create a new repository

 

[root@littlemac ~]# mkdir /home/SVN/

[root@littlemac ~]# cd /home/SVN/

[root@littlemac SVN]# svnadmin create project_x

 

Now the server is setup I will connect with my svn (short name for Subversion) client from my workstation, bigmac

First of all I will check out the blank project and create a file structure, then commit this into the project

bigmac:~ neil$ svn co svn+ssh://littlemac/home/SVN/project_x

Checked out revision 0.

bigmac:~ neil$ cd project_x/

bigmac:project_x neil$ mkdir release test admin

bigmac:project_x neil$ touch release/file test/file admin/file

bigmac:project_x neil$ svn add admin/ release/ test/

A         admin

A         admin/file

A         release

A         release/file

A         test

A         test/file

bigmac:project_x neil$ svn commit -m "Added example dirs + files"

Adding         admin

Adding         admin/file

Adding         release

Adding         release/file

Adding         test

Adding         test/file

Transmitting file data ...

Committed revision 1.

bigmac:project_x neil$

Ok , so now we have a few files and directories in our project repo to play with.

Here is the example task and configuration we will work through, and the permission scheme will end up like this:

  • Only users in the group admins are allowed to access the admin directory
  • Users in the group checkout can have read only access to the test and release directories and all files under them
  • User in the group developers can have read write access to test and release directories and all files under them
  • The user billy can only access the test directory, he is specifically denied from the other two directories release and admin

Ok, so in order to apply this scheme, we need to go back to the server and edit the file /home/SVN/project_x/svnserve.conf and set up the file as shown below.

### This file controls the configuration of the svnserve daemon

[general]

anon-access = none

auth-access = write

authz-db = authz



Now create the file authz in the same folder with the follow contents


[/]

billy=r

neil=rw

 

 



Last Updated on Tuesday, 15 September 2009 11:46  

Add your comment

Your name:
Subject:
Comment: