Authorization Configuration, Restricting Users with allowed Code Bases
Once we installed Subversion, created repository and created users with passwords, now we are able to read/write code
with all users. But we need to restrict the users with specifically allocated code branches.
Here we will see how to set up the authorization to projects folders inside the repository.
1. You need to Edit Apache2/conf/subversion.conf to tell where is the authorization file is placed.
- Inside the file, you can find a line like "#AuthzSVNAccessFile /scm/home/avn.auth" - Remove the # symbol
- Instead of the /scm/home/avn.auth, give the exact location of the auth file. That is we are going to create in the step 2.
2. You need to create authz file with authorization to repository.
- Please find the authz file anywhere inside "repository/conf" and copy to your required location.
- Add the below lines
# Allowing balaji To Read Only Tags/Branches/Trunk of spring_samples[spring_samples:/]balaji=r
# Allowing balaji To Read and Write Branches of core_java_samples only
[core_java_samples:/branches]
balaji=rw
# Allowing balaji To Read only the core_java_samples trunk
[core_java_samples:/trunk]
balaji=r
3. Restart the Wandisco Subversion Service - Go to ControlPanel, Go to System and Security, Go to Administrative Tools, Go To Services
- Here you can see all the Window Services
- Please find the Wandisco Subversion Service
- Reatart
4. Verify the authorization for core_java_samples
- Open the http://localhost:7070/svn/core_java_samples, and login with balaji.
- As the balaji allowed to read only trunk -You can view(Check out) only. You cannot commit (Check in).
- As the balaji allowed to read/write branches - you can check out anc check in the code.
- As the balaji not allowed to read/write the tags - You will not see the folder.
Tips :
If you are able to access the http://localhost:7070/svn/myrepo , but if you try to add it to your Eclipse or NetBeans as the SVN repository, then you may get "403 : Forbidden Error".
Then instead of localhost , try with 127.0.0.1 or your IP address. It will resolve the 403 issue.
1. You need to Edit Apache2/conf/subversion.conf to tell where is the authorization file is placed.
- Inside the file, you can find a line like "#AuthzSVNAccessFile /scm/home/avn.auth" - Remove the # symbol
- Instead of the /scm/home/avn.auth, give the exact location of the auth file. That is we are going to create in the step 2.
2. You need to create authz file with authorization to repository.
- Please find the authz file anywhere inside "repository/conf" and copy to your required location.
- Add the below lines
# Allowing balaji To Read Only Tags/Branches/Trunk of spring_samples[spring_samples:/]balaji=r
# Allowing balaji To Read and Write Branches of core_java_samples only
[core_java_samples:/branches]
balaji=rw
# Allowing balaji To Read only the core_java_samples trunk
[core_java_samples:/trunk]
balaji=r
3. Restart the Wandisco Subversion Service - Go to ControlPanel, Go to System and Security, Go to Administrative Tools, Go To Services
- Here you can see all the Window Services
- Please find the Wandisco Subversion Service
- Reatart
4. Verify the authorization for core_java_samples
- Open the http://localhost:7070/svn/core_java_samples, and login with balaji.
- As the balaji allowed to read only trunk -You can view(Check out) only. You cannot commit (Check in).
- As the balaji allowed to read/write branches - you can check out anc check in the code.
- As the balaji not allowed to read/write the tags - You will not see the folder.
Tips :
If you are able to access the http://localhost:7070/svn/myrepo , but if you try to add it to your Eclipse or NetBeans as the SVN repository, then you may get "403 : Forbidden Error".
Then instead of localhost , try with 127.0.0.1 or your IP address. It will resolve the 403 issue.
No comments:
Post a Comment