Reading Time: 2 minutes

Hi All, This document deals with how to set up folder-based access for svn repository.
SVN or subversion one of the other opensource version control tools. This can be used as a source control management system if you are not looking for any many features that git and other source tools provide.

Sometimes there are some needs for you to provide folder-based access on your project for certain users. Some people may need to read or some need to read-write access. This document deals with the above-mentioned scenario. I hope this will help you!!

Steps 1:

Edit your subversion.conf adding

AuthzSVNAccessFile /etc/project1_access

Adding the above file will help you manage access control on your repository. It’s required to add the above-mentioned configuration in each subversion repository configuration file. This enforces the repository to read the ACL from the above-mentioned file.

For multiple repositories you can use either the same ACL file or you can create separate files for managing. Using the same file may create some kind of confusion for the user in the ACL part. So it’s recommended using separate files for different repos. It all depends on how manages it.

 

<Location /project1>
DAV svn
SVNPath /var/www/project1/
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /etc/project_access_passwd
AuthzSVNAccessFile /etc/project1_access
Require valid-user
<LimitExcept GET PROPFIND OPTIONS REPORT HEAD>
Require valid-user
</LimitExcept>
</Location>

Step 2: Now create a file called /etc/project1_access for access control.

 

vi /etc/project1_access

Now add the below section the repo access file.

########## user1 and user2 have read and write access on the full repo, whereas user6 have only read access throughout the repository. If you define ACL [/] is required otherwise non of users will be accessing the whole repo until its defined. only the folder path mentioned will be accessed by those users mentioned in the file.

[/]
user1 = rw
user2 = rw
user6 = r

####### user3 and user 4 have read and write access on UI/react/code path under project1 repository.
[project1:/UI/react/code]
user3 = rw
user4 = rw
user5 = r

save and exit

Step 3: Now restart the apache web service.

service httpd restart

Step 4: Now open the browser with user 5 and try to navigate any other folder which doesn’t have permission. You will get a FORBIDDEN message since that folder ACL is not mentioned in the ACL file. Where the same user can access https://IP/project1/UI/react/code with only read privileges. User5 can’t do any commit access to that folder.

© 2020, Techrunnr. All rights reserved.

#1
#2
#3
Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

0 Comments

Leave a Reply