def export_authz(**kwargs): """Export authorization/authentication info""" # XXX the import here is to prevent a circular import :( design problem! from .repository import list as list_repos authz_filename = options.env_path("svn_authz_file") authz = codecs.open(str(authz_filename), "w+", "utf-8") # Write all groups authz.write("[groups]\n") for groupname in group.list(FakeAdminUser()): g = group.Group(groupname) authz.write("%s = %s\n" % (groupname, ', '.join(g.members()))) authz.write("\n") # Write all repositories and their permissions for repository in list_repos(): if repository["status"] != "ok": continue for path in permissions.list_paths(repository["name"], "svn"): authz.write("[%s:%s]\n" % (repository["name"], path)) for perm in permissions.list_by_path(repository["name"], "svn", path): if perm["type"] == "group": authz.write("@") authz.write("%s = %s\n" % (perm["name"], perm["permission"])) authz.write("\n") authz.close()
def getpermissionpaths(self, req, repos): paths = permissions.list_paths(repos.name, repos.vcs_type) templatevars = {'repository': repos.name, 'paths': paths} return XMLTemplateResponse('ajax/repositorypermpaths.xml', templatevars)