[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Restrict Directory Creation - my solution

From: Joe H-Grosse <jhg_at_isnordic.dk>
Date: 2007-08-08 11:52:36 CEST

Hi,

 

Thanks for the response – much appreciated

 

For good order, this is how I’m going to do this:

 

Background

Subversion does not seem to provide/expose (for administrative/end user use) a mechanism to test a file type and determine what it is (i.e. is it a directory or a file) – prior to it being committed.

(If anyone knows of such a mechanism – please let me know).

 

As a workaround, [svnlook] provides the ability to look at the transaction :- <svnlook changed -t "$TXN" "$REPOS">

On UNIX at least, directories added differ from files in that they have a slash appended to the path (excerpt from above svnlook command follows):

…..

A working-directories/personal/jhg/wkdir/

A working-directories/personal/jhg/wkdir/CONTEXT_diagrams_UML.mdi

…..

 

Solution #1 (workaround)

Write a small script to parse the output of svnlook and → look for all lines pre-pended with an A → then look for a trailing slash on those lines → if found, look up the transaction author in a permissions file and see if the author has been granted rights to (a) add a directory at all and (b) in the area of the tree concerned.

 

Note that it assumes (1) svnlook will format output identically on all O/S’s (2) future versions of svnlooks’ output will not change.

 

 

Solution #2

Extend svnlook with an option to allow it to return filetype meta-data on transactions prior to commit → and then validate the transaction as per Solution #1 above.

 

 

Regards,

 

Joe

From: Joe H-Grosse [mailto:jhg@isnordic.dk]
Sent: 7. august 2007 13:58
To: 'users@subversion.tigris.org'
Subject: Restrict Directory Creation

 

Hi,

 

We are using subversion for versioning and storing documents.

 

What I want to know is if it is possible to allow users to create, delete and update files everywhere in the repository – but restrict the creation of additional directories to an authorised sub-set of users.

 

The reason for this is that the directories’ nomenclature are an important part of the indexing and categorising scheme we use and also help users navigate around the repository to retrieve documents, as such, any additions to the directory infrastructure need to be reviewed to ensure that they are necessary – otherwise it becomes increasingly hard to find things – and it is hard to get users to remember to adhere to and use an organisation-wide nomenclature for directories – so strange names start to appear that don’t necessarily give as good guide as they should as to what their contents will be..

 

Thanks in advance…

 

regards

 

Joe

 
Received on Wed Aug 8 11:51:04 2007

This is an archived mail posted to the Subversion Users mailing list.