Subversion - restrict file types on Update for 1 user
We have a test engineer that does not need access to all of our firmware except the output .hex
files. It would be nice to set him up with subversion so that he can Update and get the latest versions of our firmware and all that he would see 开发者_JS百科on his end are the .hex
files.
You don't want him updating these files, but he can check them out? You can use a pre-commit trigger to do just that. I have one that allows you to restrict who can do what based upon file and directory names. These can be specified via glob (**/*.hex
) or regular expression (/.*\.hex$/
).
If you don't want him to even be able to checkout any files but *.hex
files, you'll have some problems unless they're all in the same directory.
Subversion lets you can specify directory access for read/write, but not individual file access. Thus, if your *.hex
files are in a single directory tree, you could grant this user access to that tree only. But, if these are scattered throughout the repository, you'll have a harder time.
I'm not sure if limiting access like that is possible with just SVN, but it might be possible if you are using Apache to handle the authorization. (I haven't done this before so I'm not sure)
However, if you can't get the permissions to work correctly, you could just have a post-commit script that checks out the current version from the repository and strips away all files except the *.hex
files. Your test engineer could then just rsync to that set of files (or use any other file transfer method) to get a copy of just the *.hex
files.
This requires a bit of scripting skill to put together the post-commit script, but I think it would be much simpler than trying to limit access to only a specific file pattern.
精彩评论