File tree Expand file tree Collapse file tree 2 files changed +65
-0
lines changed
Expand file tree Collapse file tree 2 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 162162
163163noting that your definition of the nosy Multilink will override the normal one.
164164
165+
1651660.5.0 User schema changes
166167~~~~~~~~~~~~~~~~~~~~~~~~~
167168
@@ -298,6 +299,30 @@ You may verify the setup of Permissions and Roles using the new
298299"``roundup-admin security``" command.
299300
300301
302+ 0.5.0 User changes
303+ ~~~~~~~~~~~~~~~~~~
304+
305+ To support all those schema changes, you'll need to massage your user database
306+ a little too, to:
307+
308+ 1. make sure there's an "anonymous" user - this user is mandatory now and is
309+ the one that unknown users are logged in as.
310+ 2. make sure all users have at least one Role.
311+
312+ If you don't have the "anonymous" user, create it now with the command::
313+
314+ roundup-admin create user username=anonymous roles=Anonymous
315+
316+ making sure the capitalisation is the same as above. Once you've done that,
317+ you'll need to set the roles property on all users to a reasonable default.
318+ The admin user should get "Admin", the anonymous user "Anonymous"
319+ and all other users "User". The ``fixroles.py`` script in the tools directory
320+ will do this. Run it like so (where python is your python 2+ binary)::
321+
322+ python tools/fixroles.py -i <instance home>
323+
324+
325+
3013260.5.0 CGI interface changes
302327---------------------------
303328
Original file line number Diff line number Diff line change 1+ import sys
2+
3+ from roundup import admin
4+
5+ class AdminTool (admin .AdminTool ):
6+ def __init__ (self ):
7+ self .commands = admin .CommandDict ()
8+ for k in AdminTool .__dict__ .keys ():
9+ if k [:3 ] == 'do_' :
10+ self .commands [k [3 :]] = getattr (self , k )
11+ self .help = {}
12+ for k in AdminTool .__dict__ .keys ():
13+ if k [:5 ] == 'help_' :
14+ self .help [k [5 :]] = getattr (self , k )
15+ self .instance_home = ''
16+ self .db = None
17+
18+ def do_fixroles (self , args ):
19+ '''Usage: fixroles
20+ Set the roles property for all users to reasonable defaults.
21+
22+ The admin user gets "Admin", the anonymous user gets "Anonymous"
23+ and all other users get "User".
24+ '''
25+ # get the user class
26+ cl = self .get_class ('user' )
27+ for userid in cl .list ():
28+ username = cl .get (userid , 'username' )
29+ if username == 'admin' :
30+ roles = 'Admin'
31+ elif username == 'anonymous' :
32+ roles = 'Anonymous'
33+ else :
34+ roles = 'User'
35+ cl .set (userid , roles = roles )
36+ return 0
37+
38+ if __name__ == '__main__' :
39+ tool = AdminTool ()
40+ sys .exit (tool .main ())
You can’t perform that action at this time.
0 commit comments