comparison tools/fixroles.py @ 2410:52c8324d1539

tabs
author Richard Jones <richard@users.sourceforge.net>
date Wed, 09 Jun 2004 04:51:07 +0000
parents fc55426544b5
children
comparison
equal deleted inserted replaced
2409:096063697f77 2410:52c8324d1539
20 Set the roles property for all users to reasonable defaults. 20 Set the roles property for all users to reasonable defaults.
21 21
22 The admin user gets "Admin", the anonymous user gets "Anonymous" 22 The admin user gets "Admin", the anonymous user gets "Anonymous"
23 and all other users get "User". 23 and all other users get "User".
24 ''' 24 '''
25 # get the user class 25 # get the user class
26 cl = self.get_class('user') 26 cl = self.get_class('user')
27 for userid in cl.list(): 27 for userid in cl.list():
28 username = cl.get(userid, 'username') 28 username = cl.get(userid, 'username')
29 if username == 'admin': 29 if username == 'admin':
30 roles = 'Admin' 30 roles = 'Admin'
31 elif username == 'anonymous': 31 elif username == 'anonymous':
32 roles = 'Anonymous' 32 roles = 'Anonymous'
33 else: 33 else:
34 roles = 'User' 34 roles = 'User'
35 cl.set(userid, roles=roles) 35 cl.set(userid, roles=roles)
36 return 0 36 return 0
37 37
38 if __name__ == '__main__': 38 if __name__ == '__main__':
39 tool = AdminTool() 39 tool = AdminTool()
40 sys.exit(tool.main()) 40 sys.exit(tool.main())

Roundup Issue Tracker: http://roundup-tracker.org/