comparison templates/classic/schema.py @ 2633:a9e1fff1e793

I thought I committed this last night. Ho hum. - This implements most of the rest of the new tracker config layout: - dbinit.py split between schema.py and initial_data.py - interfaces.py gone - tracker and detectors __init__.py gone - Added some missing functionality to backends: db_exists test and db_nuke. - Implemented configuration file options in postgresql backend. - Cleaned up tracker initialisation a lot.
author Richard Jones <richard@users.sourceforge.net>
date Tue, 27 Jul 2004 00:57:19 +0000
parents
children 18e86941c950
comparison
equal deleted inserted replaced
2632:9c55f2bc5961 2633:a9e1fff1e793
1
2 #
3 # TRACKER SCHEMA
4 #
5
6 # Class automatically gets these properties:
7 # creation = Date()
8 # activity = Date()
9 # creator = Link('user')
10 # actor = Link('user')
11
12 # Priorities
13 pri = Class(db, "priority",
14 name=String(),
15 order=Number())
16 pri.setkey("name")
17
18 # Statuses
19 stat = Class(db, "status",
20 name=String(),
21 order=Number())
22 stat.setkey("name")
23
24 # Keywords
25 keyword = Class(db, "keyword",
26 name=String())
27 keyword.setkey("name")
28
29 # User-defined saved searches
30 query = Class(db, "query",
31 klass=String(),
32 name=String(),
33 url=String(),
34 private_for=Link('user'))
35
36 # add any additional database schema configuration here
37
38 user = Class(db, "user",
39 username=String(),
40 password=Password(),
41 address=String(),
42 realname=String(),
43 phone=String(),
44 organisation=String(),
45 alternate_addresses=String(),
46 queries=Multilink('query'),
47 roles=String(), # comma-separated string of Role names
48 timezone=String())
49 user.setkey("username")
50
51 # FileClass automatically gets this property in addition to the Class ones:
52 # content = String() [saved to disk in <tracker home>/db/files/]
53 msg = FileClass(db, "msg",
54 author=Link("user", do_journal='no'),
55 recipients=Multilink("user", do_journal='no'),
56 date=Date(),
57 summary=String(),
58 files=Multilink("file"),
59 messageid=String(),
60 inreplyto=String())
61
62 file = FileClass(db, "file",
63 name=String(),
64 type=String())
65
66 # IssueClass automatically gets these properties in addition to the Class ones:
67 # title = String()
68 # messages = Multilink("msg")
69 # files = Multilink("file")
70 # nosy = Multilink("user")
71 # superseder = Multilink("issue")
72 issue = IssueClass(db, "issue",
73 assignedto=Link("user"),
74 topic=Multilink("keyword"),
75 priority=Link("priority"),
76 status=Link("status"))
77
78 #
79 # TRACKER SECURITY SETTINGS
80 #
81 # See the configuration and customisation document for information
82 # about security setup.
83 # Assign the access and edit Permissions for issue, file and message
84 # to regular users now
85 for cl in 'issue', 'file', 'msg', 'query', 'keyword':
86 p = db.security.getPermission('View', cl)
87 db.security.addPermissionToRole('User', p)
88 p = db.security.getPermission('Edit', cl)
89 db.security.addPermissionToRole('User', p)
90 for cl in 'priority', 'status':
91 p = db.security.getPermission('View', cl)
92 db.security.addPermissionToRole('User', p)
93
94 # and give the regular users access to the web and email interface
95 p = db.security.getPermission('Web Access')
96 db.security.addPermissionToRole('User', p)
97 p = db.security.getPermission('Email Access')
98 db.security.addPermissionToRole('User', p)
99
100 # May users view other user information? Comment these lines out
101 # if you don't want them to
102 p = db.security.getPermission('View', 'user')
103 db.security.addPermissionToRole('User', p)
104
105 # Assign the appropriate permissions to the anonymous user's Anonymous
106 # Role. Choices here are:
107 # - Allow anonymous users to register through the web
108 p = db.security.getPermission('Web Registration')
109 db.security.addPermissionToRole('Anonymous', p)
110 # - Allow anonymous (new) users to register through the email gateway
111 p = db.security.getPermission('Email Registration')
112 db.security.addPermissionToRole('Anonymous', p)
113 # - Allow anonymous users access to view issues (which implies being
114 # able to view all linked information too
115 for cl in 'issue', 'file', 'msg', 'keyword', 'priority', 'status':
116 p = db.security.getPermission('View', cl)
117 db.security.addPermissionToRole('Anonymous', p)
118 # - Allow anonymous users access to edit the "issue" class of data
119 # Note: this also grants access to create related information like
120 # files and messages etc that are linked to issues
121 #p = db.security.getPermission('Edit', 'issue')
122 #db.security.addPermissionToRole('Anonymous', p)
123
124 # oh, g'wan, let anonymous access the web interface too
125 p = db.security.getPermission('Web Access')
126 db.security.addPermissionToRole('Anonymous', p)
127
128
129 # vim: set filetype=python sts=4 sw=4 et si

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