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

[PATCH] Make svnperms.py handle nested groups

From: Kyle George <kgeorge_at_tcpsoft.com>
Date: 2007-07-03 22:23:55 CEST

svnperms.py should be able to handle simple cases of groups containing
other groups like some of the other hook scripts and mod_authz_svn.
Nested groups are expanded in place. Forward declarations are prohibited,
and this is probably a good thing. This is a slightly cleaner version of
a patch I found in the archives:

http://svn.haxx.se/dev/archive-2003-09/0569.shtml

--- svnperms.py.orig Tue Jul 3 15:47:32 2007
+++ svnperms.py Tue Jul 3 16:09:01 2007
@@ -98,7 +98,17 @@

      def parse_groups(self, groupsiter):
          for option, value in groupsiter:
- self._group[option] = value.split()
+ groupusers = []
+ for token in value.split():
+ # expand nested groups in place; no forward decls
+ if token[0] == "@":
+ try:
+ groupusers.extend(self._group[token[1:]])
+ except KeyError:
+ raise Error, "group '%s' not found" % token[1:]
+ else:
+ groupusers.append(token)
+ self._group[option] = groupusers

      def parse_perms(self, permsiter):
          for option, value in permsiter:

-- 
Kyle George
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 3 22:23:49 2007

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