我可以阻止用户使用 TortoiseSVN 和 RapidSVN 从服务器删除文件吗?
当用户使用 TortoiseSVN 和 RapidSVN 时,他会看到服务器上的文件,因此能够删除它们。 我想阻止这种情况发生。 也许阻止删除选项?
为了澄清,我希望从服务器删除文件的唯一方法是用户从本地驱动器删除它,然后将其提交到服务器。 我想限制任何用户直接从服务器删除的能力。
When a user is using TortoiseSVN and RapidSVN, he sees the files as they are on the server, and thus has the ability to delete them. I want to prevent that. Maybe to block the option to delete?
To clarify, I want the only way a file will be deleted from a server is that a user deletes it from his local drive, and then commits it to the server. I want to restrict the ability of any user to delete directly from the server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一如既往,试图阻止客户端发生任何事情本质上是不安全的。 您的用户始终可以使用不同的客户端。
因此,您需要管理服务器端(在存储库本身)的访问权限。 不幸的是,据我所知,SVN 本身仅支持“读”和“写”访问级别。 授予某人“写”访问权限意味着用户不仅能够修改现有文件,还可以添加新文件和删除现有文件。
您也许可以通过预提交挂钩添加此功能。
Trying to prevent anything on the client side is, as always, inherently insecure. Your users could always use a different client.
So you need to manage the access rights on the server side (in the repository itself). Unfortunately, as far as I know, SVN natively supports only "read" and "write" access levels. Giving someone "write" access means that the user is not only able to modify existing files, but also to add new files and to delete existing ones.
You might be able to add this functionality via a pre-commit hook.
通过添加预提交挂钩来防止删除。
在 Windows 中,可以通过在“Your_SVN_repository\hooks\”中添加“pre-commit.bat”来完成,其内容如下。
Prevent deletions by adding pre-commit hook.
In windows this can be done by adding "pre-commit.bat" in "Your_SVN_repository\hooks\" with content as follows.