|
|
@ -87,6 +87,7 @@ class AuthzConfigParser(ConfigParser.ConfigParser, object): |
|
|
|
return str(value) |
|
|
|
return str(value) |
|
|
|
|
|
|
|
|
|
|
|
def read(self, path): |
|
|
|
def read(self, path): |
|
|
|
|
|
|
|
""" set up the acl defaults after reading the file """ |
|
|
|
super(AuthzConfigParser, self).read(path) |
|
|
|
super(AuthzConfigParser, self).read(path) |
|
|
|
self._acl_defaults = self.get_folder_info("") |
|
|
|
self._acl_defaults = self.get_folder_info("") |
|
|
|
|
|
|
|
|
|
|
@ -125,6 +126,7 @@ class AuthzConfigParser(ConfigParser.ConfigParser, object): |
|
|
|
for (option, value) in self.items(name): |
|
|
|
for (option, value) in self.items(name): |
|
|
|
if value in (WRITE_ACL, READ_ACL): |
|
|
|
if value in (WRITE_ACL, READ_ACL): |
|
|
|
info[value].append(option) |
|
|
|
info[value].append(option) |
|
|
|
|
|
|
|
# remove explicit dismissed acls |
|
|
|
if not value: |
|
|
|
if not value: |
|
|
|
for acltype in (WRITE_ACL, READ_ACL): |
|
|
|
for acltype in (WRITE_ACL, READ_ACL): |
|
|
|
if option in info[acltype]: |
|
|
|
if option in info[acltype]: |
|
|
@ -273,7 +275,7 @@ if __name__ == "__main__": |
|
|
|
sys.exit() |
|
|
|
sys.exit() |
|
|
|
|
|
|
|
|
|
|
|
# no option, just a name: |
|
|
|
# no option, just a name: |
|
|
|
# print all the infos connected to a name |
|
|
|
# print the write acls for a user |
|
|
|
print "User %s is in group '%s':" % (name, user.group) |
|
|
|
print "User %s is in group '%s':" % (name, user.group) |
|
|
|
if user.group == ADMINS: |
|
|
|
if user.group == ADMINS: |
|
|
|
print " Write access is granted to all folders." |
|
|
|
print " Write access is granted to all folders." |
|
|
@ -282,19 +284,24 @@ if __name__ == "__main__": |
|
|
|
print " Write access is granted to folders '%s'. " % "', '".join(write_acl) |
|
|
|
print " Write access is granted to folders '%s'. " % "', '".join(write_acl) |
|
|
|
else: |
|
|
|
else: |
|
|
|
print " Write access is NOT granted to any folder" |
|
|
|
print " Write access is NOT granted to any folder" |
|
|
|
if user.group in (ADMINS, REGULAR): |
|
|
|
# print the read acls for a user |
|
|
|
|
|
|
|
if user.group == ADMINS: |
|
|
|
print " Read access is granted to all folders." |
|
|
|
print " Read access is granted to all folders." |
|
|
|
|
|
|
|
elif user.group == REGULAR: |
|
|
|
|
|
|
|
print " Read access is granted to (nearly) all folders." |
|
|
|
elif user.read_acl: |
|
|
|
elif user.read_acl: |
|
|
|
read_acl = [ SVN_BASE + username for username in user.read_acl ] |
|
|
|
read_acl = [ SVN_BASE + username for username in user.read_acl ] |
|
|
|
print " Read access is granted to folders '%s'. " % "', '".join(read_acl) |
|
|
|
print " Read access is granted to folders '%s'. " % "', '".join(read_acl) |
|
|
|
else: |
|
|
|
else: |
|
|
|
print " Read access is NOT granted to any folder" |
|
|
|
print " Read access is NOT granted to any folder" |
|
|
|
|
|
|
|
# print the write acls for a journal |
|
|
|
info = config.get_folder_info(name) |
|
|
|
info = config.get_folder_info(name) |
|
|
|
print "Labjornal %s%s:" % (SVN_BASE, name) |
|
|
|
print "Labjornal %s%s:" % (SVN_BASE, name) |
|
|
|
if info[WRITE_ACL]: |
|
|
|
if info[WRITE_ACL]: |
|
|
|
print " Write and read access granted to: " + ", ".join(info[WRITE_ACL]) |
|
|
|
print " Write and read access granted to: " + ", ".join(info[WRITE_ACL]) |
|
|
|
else: |
|
|
|
else: |
|
|
|
print " No write access granted to anybody" |
|
|
|
print " No write access granted to anybody" |
|
|
|
|
|
|
|
# print the read acls for a journal |
|
|
|
if info[READ_ACL]: |
|
|
|
if info[READ_ACL]: |
|
|
|
print " Read access granted to: " + ", ".join(info[READ_ACL]) |
|
|
|
print " Read access granted to: " + ", ".join(info[READ_ACL]) |
|
|
|
else: |
|
|
|
else: |
|
|
|