Does SharpSVN have an API to manage repository permissions
Does anyone know if there is any API exposed to manage repository permissions within SharpSVN? For example, programatically adding read and write permissions on a per repository basis.
Alternatively, any other thoughts on managing permissions with other SVN APIs? Worst case wil be manually managing the contents of svnaccessfile but this is a last resort. Thanks.
It looks like that because SharpSvn is just a .NET API wrapper around the Subversion command line tool and this does not include a mechanism for managing permissions, this is not doable (see here). Different Subversion distributions manage permissions in different fashions so approaches to controlling this outside of SharpSvn will differ.
Visual SVN server utilises an authz-windows file in the root of the repository for managing AD based permissions. It stores the SID of the user against the repo name all in plain text so I’ve worked around the API problem by just managing the contents of this file directly. Not as elegant as I was hoping for but the end result is the same.
As @TroyHunt posted, it is not possible to use SharpSVN to manage Subversion access rules. In fact, every Subversion+Apache server that uses mod_authz_svn can be configured to use a number of authorization lists. They can be per-repository authz files, authz files for the whole sever instance or even in-repo authz files (available beginning with Subversion 1.8). Therefore, there is no standard way for access rules management that will suit all Subversion installations. However, you can always write your own script specifically for your Subversion server installation just because Subversion authz files have a very simple format.
The original answer implies that you were using VisualSVN Server. In such case I have good news for you because VisualSVN Server 3.4 introduced a number of PowerShell cmdlets for server and repos administration. In the most recent 3.5 release, there are actually 29 cmdlets and cmdlets to manage access rules are among them:
For more information about the cmdlets and usage examples, please read the article KB88: VisualSVN Server PowerShell Cmdlet Reference.