There are two methods that can be used:
- Access control lists
- Pre-commit hooks
Access control lists can be used to take away write permission for users. SVN uses two files to configure access: authz and passwd (both located in the conf directory of your repository). Passwd defines users + their passwords and groups of users. Authz defines permissions on repos and their contents for the users and groups defined in passwd. Here is a sample.
Pre-commit hooks can be applied to a path and will reject any write actions. Here is documentation on how to create hooks. Here is python code for a hook and here is a sample configuration for said hook. Basically you put an executable file into svn's repos/hooks folder and give it the name of a hook (the names are based on the operation being performed). Command line parameters are given to the executable by SVN and the executable can perform validation, etc. SVN comes with sample hooks that have a .tmpl filename extension. You can remove this extension to enable the default hook.
No comments:
Post a Comment