You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jennifer Kesterson <je...@mail2.jpl.nasa.gov> on 2004/12/09 17:29:07 UTC

Hook script to restrict access on per user basis?

Is it possible to use a hook script to restrict access to the repository on 
a per user basis?  I'm the administrator but I'm not a programmer and I 
don't have a clue as to where or how to begin, or if it is even possible.

We do have a users file with user names and passwords.

Thanks,
Jennifer


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Hook script to restrict access on per user basis?

Posted by François Beausoleil <fb...@ftml.net>.

On 09/12/2004 12:29, Jennifer Kesterson wrote:
> Is it possible to use a hook script to restrict access to the repository 
> on a per user basis?  I'm the administrator but I'm not a programmer and 
> I don't have a clue as to where or how to begin, or if it is even possible.
> 
> We do have a users file with user names and passwords.

What method of access do you use ?  If you use ra_dav (http) 
exclusively, check the details of mod_authz_svn.  See 
http://svnbook.red-bean.com/en/1.0/ch06s04.html#svn-ch-6-sect-4.4.2

If you use another method, or use different methods simultaneously, you 
can use the hook scripts to do that.  See svnperms.py in 
http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/

Hope that helps !
François

Re: Hook script to restrict access on per user basis?

Posted by François Beausoleil <fb...@ftml.net>.
Hello Jennifer,

You haven't replied to the list, so I'm so I'm bringing everything back 
to the list.

On 10/12/2004 12:37, Jennifer Kesterson wrote:
> Honestly, I can't figure out the hook scripts.  It appears they run a 
> Perl script (*.pl)?  Since I am not a programmer I don't know where to 
> begin with them. :-/

Hook scripts are special programs that Subversion executes on certain 
specific operations.  The one you are interested in is the pre-commit 
hook script.

Check your repository's hooks/ folder, to find templates in there. 
Depending on your OS, you'll need to rename the existing pre-commit hook 
template to *.sh or *.bat (Linux/Windows).

Then, following the instructions in the template, you'll call 
svnperms.py with the arguments as listed in svnperms.py.  svnperms.py 
will return some kind of error to the caller, which will in turn return 
a code to Subversion, which will turn around again and tell the client 
whether or not his commit was successful.

I hope this was useful.  If not, ask again, and someone will clarify.

Bye !
François