Subversion - 限制 1 位用户更新时的文件类型
我们的测试工程师不需要访问除输出 .hex
文件之外的所有固件。最好为他设置 subversion,以便他可以更新并获取我们固件的最新版本,并且他在终端上看到的只是 .hex
文件。
这需要适用于他这边的整个存储库。
我知道我可以将他的访问权限限制为只读,但我们想更进一步。我也知道这不是最佳实践,但我只是想知道这是否可能。
谢谢。
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 on his end are the .hex
files.
This would need to be for the entire repository on his end.
I know I can just limit his access to read-only, but we would like to take it a step further. I also know its not the best practice, but I'm just wondering if this is possible.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不希望他更新这些文件,但他可以查看它们?您可以使用预提交触发器来做到这一点。我有一个,可以让你根据文件和目录限制谁可以做什么名称。这些可以通过 glob (
**/*.hex
) 或正则表达式 (/.*\.hex$/
) 指定。如果您甚至不希望他能够签出除
*.hex
文件之外的任何文件,那么您将会遇到一些问题,除非它们都位于同一目录中。Subversion 允许您指定读/写目录访问,但不能指定单个文件访问。因此,如果您的
*.hex
文件位于单个目录树中,您只能授予该用户对该树的访问权限。但是,如果它们分散在整个存储库中,您就会遇到困难。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.我不确定仅使用 SVN 是否可以限制这样的访问,但如果您使用 Apache 来处理授权,则可能是可能的。 (我以前没有这样做过,所以我不确定)
但是,如果您无法获得正常工作的权限,您可以使用一个提交后脚本来从存储库中检查当前版本并删除除
*.hex
文件之外的所有文件。然后,您的测试工程师只需 rsync 到该组文件(或使用任何其他文件传输方法)即可获取*.hex
文件的副本。这需要一些脚本编写技巧来组合提交后脚本,但我认为这比尝试限制仅访问特定文件模式要简单得多。
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.