Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User permissions for add/remove a file/folder in svn

I have a requirement that I need to control the permission to add/delete(not read/modify/write) a file in svn. I checked if svn access control has ways to do it. But it does not seems to have this kind of restriction.

I was checking for some precommits which can do this operation and round the svnperms hook has this functionality. However it also has the similar implementation of access control, so I am not sure if I want to use this in combination with the access control script.

So can I have some suggestion on the best way to implement add/remove permissions for users ?

like image 804
Version Control Buddy Avatar asked Apr 15 '11 09:04

Version Control Buddy


People also ask

How do I change permissions in svn?

How to change default repository access permissions: Select the SVN repo you would like to protect directories within from the tools dropdown menu. Go to the Settings sub-tab on the SVN repository tab, then click the Protected Directories link on the left side.

How remove checked out folder from svn?

Use TortoiseSVN → Delete to remove files or folders from Subversion. When you TortoiseSVN → Delete a file or folder, it is removed from your working copy immediately as well as being marked for deletion in the repository on next commit.


1 Answers

I have a Perl pre-commit hook that allows you to set "add" access. This is mainly used for tags (You can create a tag, but not modify a tag), but I imagine it could be to check to see if a specific file was added. I don't have specific delete only access in my pre-commit hook although this shouldn't be too difficult to add.

My preference has been to use the server's access control list to give read/write access to the repository, then take away write access via my pre-commit hook. (There's no pre-checkout hook, so there's no way to prevent read access in a hook itself.)

Feel free to take a look at it and see if you can add the "add-delete" access you need. Shouldn't be too difficult. I pretty much take the output of svnserve log and parse that to find out if a file has been added, deleted, modified, etc.

like image 165
David W. Avatar answered Sep 22 '22 13:09

David W.