summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a306fd4)
raw | patch | inline | side by side (parent: a306fd4)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 2 Sep 2002 08:11:02 +0000 (08:11 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 2 Sep 2002 08:11:02 +0000 (08:11 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1026 57a73879-2fb5-44c3-a270-3262357dd7e2
doc/upgrading.txt | patch | blob | history | |
tools/fixroles.py | [new file with mode: 0644] | patch | blob |
diff --git a/doc/upgrading.txt b/doc/upgrading.txt
index 21074a2fec6483f7a46e33d813d5d1013520b494..c14a40ce02bfd497da16a7e5d7b4b9524c9847d4 100644 (file)
--- a/doc/upgrading.txt
+++ b/doc/upgrading.txt
noting that your definition of the nosy Multilink will override the normal one.
+
0.5.0 User schema changes
~~~~~~~~~~~~~~~~~~~~~~~~~
"``roundup-admin security``" command.
+0.5.0 User changes
+~~~~~~~~~~~~~~~~~~
+
+To support all those schema changes, you'll need to massage your user database
+a little too, to:
+
+1. make sure there's an "anonymous" user - this user is mandatory now and is
+ the one that unknown users are logged in as.
+2. make sure all users have at least one Role.
+
+If you don't have the "anonymous" user, create it now with the command::
+
+ roundup-admin create user username=anonymous roles=Anonymous
+
+making sure the capitalisation is the same as above. Once you've done that,
+you'll need to set the roles property on all users to a reasonable default.
+The admin user should get "Admin", the anonymous user "Anonymous"
+and all other users "User". The ``fixroles.py`` script in the tools directory
+will do this. Run it like so (where python is your python 2+ binary)::
+
+ python tools/fixroles.py -i <instance home>
+
+
+
0.5.0 CGI interface changes
---------------------------
diff --git a/tools/fixroles.py b/tools/fixroles.py
--- /dev/null
+++ b/tools/fixroles.py
@@ -0,0 +1,40 @@
+import sys
+
+from roundup import admin
+
+class AdminTool(admin.AdminTool):
+ def __init__(self):
+ self.commands = admin.CommandDict()
+ for k in AdminTool.__dict__.keys():
+ if k[:3] == 'do_':
+ self.commands[k[3:]] = getattr(self, k)
+ self.help = {}
+ for k in AdminTool.__dict__.keys():
+ if k[:5] == 'help_':
+ self.help[k[5:]] = getattr(self, k)
+ self.instance_home = ''
+ self.db = None
+
+ def do_fixroles(self, args):
+ '''Usage: fixroles
+ Set the roles property for all users to reasonable defaults.
+
+ The admin user gets "Admin", the anonymous user gets "Anonymous"
+ and all other users get "User".
+ '''
+ # get the user class
+ cl = self.get_class('user')
+ for userid in cl.list():
+ username = cl.get(userid, 'username')
+ if username == 'admin':
+ roles = 'Admin'
+ elif username == 'anonymous':
+ roles = 'Anonymous'
+ else:
+ roles = 'User'
+ cl.set(userid, roles=roles)
+ return 0
+
+if __name__ == '__main__':
+ tool = AdminTool()
+ sys.exit(tool.main())