comparison doc/customizing.txt @ 3276:3124e578db02

Email fixes: - fix checking of "Email Access" for Anonymous email registration [SF#177057] - disable "Email Access" for Anonymous by default to stop spam regsitering users on public trackers - doc fixes / additions too
author Richard Jones <richard@users.sourceforge.net>
date Wed, 13 Apr 2005 03:38:23 +0000
parents e41e1540a287
children 5da323b46907
comparison
equal deleted inserted replaced
3274:3e216b862018 3276:3124e578db02
1 =================== 1 ===================
2 Customising Roundup 2 Customising Roundup
3 =================== 3 ===================
4 4
5 :Version: $Revision: 1.176 $ 5 :Version: $Revision: 1.177 $
6 6
7 .. This document borrows from the ZopeBook section on ZPT. The original is at: 7 .. This document borrows from the ZopeBook section on ZPT. The original is at:
8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
9 9
10 .. contents:: 10 .. contents::
16 Before you get too far, it's probably worth having a quick read of the Roundup 16 Before you get too far, it's probably worth having a quick read of the Roundup
17 `design documentation`_. 17 `design documentation`_.
18 18
19 Customisation of Roundup can take one of six forms: 19 Customisation of Roundup can take one of six forms:
20 20
21 1. `tracker configuration`_ file changes 21 1. `tracker configuration`_ changes
22 2. database, or `tracker schema`_ changes 22 2. database, or `tracker schema`_ changes
23 3. "definition" class `database content`_ changes 23 3. "definition" class `database content`_ changes
24 4. behavioural changes, through detectors_ 24 4. behavioural changes, through detectors_
25 5. `security / access controls`_ 25 5. `security / access controls`_
26 6. change the `web interface`_ 26 6. change the `web interface`_
56 ===================== 56 =====================
57 57
58 The ``config.ini`` located in your tracker home contains the basic 58 The ``config.ini`` located in your tracker home contains the basic
59 configuration for the web and e-mail components of roundup's interfaces. 59 configuration for the web and e-mail components of roundup's interfaces.
60 60
61 Changes to the data captured by your tracker is controlled by the `tracker
62 schema`_. Some configuration is also performed using permissions - see the
63 `security / access controls`_ section. For example, to allow users to
64 automatically register through the email interface, you must grant the
65 "Anonymous" Role the "Email Access" Permission.
66
61 The following is taken from the `Python Library Reference`__ (May 20, 2004) 67 The following is taken from the `Python Library Reference`__ (May 20, 2004)
62 section "ConfigParser -- Configuration file parser": 68 section "ConfigParser -- Configuration file parser":
63 69
64 The configuration file consists of sections, led by a "[section]" header 70 The configuration file consists of sections, led by a "[section]" header
65 and followed by "name = value" entries, with line continuations on a 71 and followed by "name = value" entries, with line continuations on a
76 82
77 would resolve the "%(dir)s" to the value of "dir" ("frob" in this case) 83 would resolve the "%(dir)s" to the value of "dir" ("frob" in this case)
78 resulting in "foodir" being "frob/whatever". 84 resulting in "foodir" being "frob/whatever".
79 85
80 __ http://docs.python.org/lib/module-ConfigParser.html 86 __ http://docs.python.org/lib/module-ConfigParser.html
81
82 Configuration variables may be referred to in lower or upper case. In code,
83 variables not in the "main" section are referred to using their section and
84 name, so "domain" in the section "mail" becomes MAIL_DOMAIN. The
85 configuration variables available are:
86 87
87 Section **main** 88 Section **main**
88 database -- ``db`` 89 database -- ``db``
89 Database directory path. The path may be either absolute or relative 90 Database directory path. The path may be either absolute or relative
90 to the directory containig this config file. 91 to the directory containig this config file.
279 on followups too. If ``no``, they're never added to the nosy. 280 on followups too. If ``no``, they're never added to the nosy.
280 Allowed values: ``yes``, ``no``, ``new`` 281 Allowed values: ``yes``, ``no``, ``new``
281 282
282 You may generate a new default config file using the ``roundup-admin 283 You may generate a new default config file using the ``roundup-admin
283 genconfig`` command. 284 genconfig`` command.
285
286 Configuration variables may be referred to in lower or upper case. In code,
287 variables not in the "main" section are referred to using their section and
288 name, so "domain" in the section "mail" becomes MAIL_DOMAIN. The
289 configuration variables available are:
284 290
285 291
286 Tracker Schema 292 Tracker Schema
287 ============== 293 ==============
288 294
738 744
739 - Create (everything) 745 - Create (everything)
740 - Edit (everything) 746 - Edit (everything)
741 - View (everything) 747 - View (everything)
742 748
743 Every Class you define in your tracker's schema also gets an Create, Edit 749 These are assigned to the "Admin" Role by default, and allow a user to do
744 and View Permission of its own. 750 anything. Every Class you define in your `tracker schema`_ also gets an
745 751 Create, Edit and View Permission of its own. The web and email interfaces
746 The default interfaces define: 752 also define:
747 753
748 - Web Registration 754 *Email Access*
749 - Web Access 755 If defined, the user may use the email interface. Used by default to deny
750 - Web Roles 756 Anonymous users access to the email interface. When granted to the
751 - Email Registration 757 Anonymous user, they will be automatically registered by the email
752 - Email Access 758 interface (see also the ``new_email_user_roles`` configuration option).
759 *Web Access*
760 If defined, the user may use the web interface. All users are able to see
761 the login form, regardless of this setting (thus enabling logging in).
762 *Web Roles*
763 Controls user access to editing the "roles" property of the "user" class.
764 TODO: deprecate in favour of a property-based control.
753 765
754 These are hooked into the default Roles: 766 These are hooked into the default Roles:
755 767
756 - Admin (Create, Edit, View and everything; Web Roles) 768 - Admin (Create, Edit, View and everything; Web Roles)
757 - User (Web Access; Email Access) 769 - User (Web Access; Email Access)
758 - Anonymous (Web Registration; Email Registration) 770 - Anonymous (Web Access)
759 771
760 And finally, the "admin" user gets the "Admin" Role, and the "anonymous" 772 And finally, the "admin" user gets the "Admin" Role, and the "anonymous"
761 user gets "Anonymous" assigned when the tracker is installed. 773 user gets "Anonymous" assigned when the tracker is installed.
762 774
763 For the "User" Role, the "classic" tracker defines: 775 For the "User" Role, the "classic" tracker defines:
764 776
765 - Create, Edit and View issue, file, msg, query, keyword 777 - Create, Edit and View issue, file, msg, query, keyword
766 - View priority, status 778 - View priority, status
767 - View user 779 - View user
768 - Edit their own record 780 - Edit their own user record
769 781
770 And the "Anonymous" Role is defined as: 782 And the "Anonymous" Role is defined as:
771 783
784 - Web interface access
772 - Create user (for registration) 785 - Create user (for registration)
773 - View issue, file, msg, query, keyword, priority, status 786 - View issue, file, msg, query, keyword, priority, status
774 787
775 Put together, these settings appear in the tracker's ``schema.py`` file:: 788 Put together, these settings appear in the tracker's ``schema.py`` file::
776 789
782 795
783 # 796 #
784 # REGULAR USERS 797 # REGULAR USERS
785 # 798 #
786 # Give the regular users access to the web and email interface 799 # Give the regular users access to the web and email interface
787 p = db.security.getPermission('Web Access') 800 db.security.addPermissionToRole('User', 'Web Access')
788 db.security.addPermissionToRole('User', p) 801 db.security.addPermissionToRole('User', 'Email Access')
789 p = db.security.getPermission('Email Access')
790 db.security.addPermissionToRole('User', p)
791 802
792 # Assign the access and edit Permissions for issue, file and message 803 # Assign the access and edit Permissions for issue, file and message
793 # to regular users now 804 # to regular users now
794 for cl in 'issue', 'file', 'msg', 'query', 'keyword': 805 for cl in 'issue', 'file', 'msg', 'query', 'keyword':
795 p = db.security.getPermission('View', cl) 806 db.security.addPermissionToRole('User', 'View', cl)
796 db.security.addPermissionToRole('User', p) 807 db.security.addPermissionToRole('User', 'Edit', cl)
797 p = db.security.getPermission('Edit', cl) 808 db.security.addPermissionToRole('User', 'Create', cl)
798 db.security.addPermissionToRole('User', p)
799 p = db.security.getPermission('Create', cl)
800 db.security.addPermissionToRole('User', p)
801 for cl in 'priority', 'status': 809 for cl in 'priority', 'status':
802 p = db.security.getPermission('View', cl) 810 db.security.addPermissionToRole('User', 'View', cl)
803 db.security.addPermissionToRole('User', p)
804 811
805 # May users view other user information? Comment these lines out 812 # May users view other user information? Comment these lines out
806 # if you don't want them to 813 # if you don't want them to
807 p = db.security.getPermission('View', 'user') 814 db.security.addPermissionToRole('User', 'View', 'user')
808 db.security.addPermissionToRole('User', p) 815
809 816 # Users should be able to edit their own details -- this permission
810 # Users should be able to edit their own details. Note that this 817 # is limited to only the situation where the Viewed or Edited item
811 # permission is limited to only the situation where the Viewed or 818 # is their own.
812 # Edited item is their own.
813 def own_record(db, userid, itemid): 819 def own_record(db, userid, itemid):
814 '''Determine whether the userid matches the item being accessed.''' 820 '''Determine whether the userid matches the item being accessed.'''
815 return userid == itemid 821 return userid == itemid
816 p = db.security.addPermission(name='View', klass='user', check=own_record, 822 p = db.security.addPermission(name='View', klass='user', check=own_record,
817 description="User is allowed to view their own user details") 823 description="User is allowed to view their own user details")
824 db.security.addPermissionToRole('User', p)
818 p = db.security.addPermission(name='Edit', klass='user', check=own_record, 825 p = db.security.addPermission(name='Edit', klass='user', check=own_record,
819 description="User is allowed to edit their own user details") 826 description="User is allowed to edit their own user details")
820 db.security.addPermissionToRole('User', p) 827 db.security.addPermissionToRole('User', p)
821 828
822 # 829 #
823 # ANONYMOUS USER PERMISSIONS 830 # ANONYMOUS USER PERMISSIONS
824 # 831 #
825 # Let anonymous users access the web interface. Note that almost all 832 # Let anonymous users access the web interface. Note that almost all
826 # trackers will need this Permission. The only situation where it's not 833 # trackers will need this Permission. The only situation where it's not
827 # required is in a tracker that uses an HTTP Basic Authenticated front-end. 834 # required is in a tracker that uses an HTTP Basic Authenticated front-end.
828 p = db.security.getPermission('Web Access') 835 db.security.addPermissionToRole('Anonymous', 'Web Access')
829 db.security.addPermissionToRole('Anonymous', p)
830 836
831 # Let anonymous users access the email interface (note that this implies 837 # Let anonymous users access the email interface (note that this implies
832 # that they will be registered automatically, hence they will need the 838 # that they will be registered automatically, hence they will need the
833 # "Create" user Permission below) 839 # "Create" user Permission below)
834 p = db.security.getPermission('Email Access') 840 # This is disabled by default to stop spam from auto-registering users on
835 db.security.addPermissionToRole('Anonymous', p) 841 # public trackers.
842 #db.security.addPermissionToRole('Anonymous', 'Email Access')
836 843
837 # Assign the appropriate permissions to the anonymous user's Anonymous 844 # Assign the appropriate permissions to the anonymous user's Anonymous
838 # Role. Choices here are: 845 # Role. Choices here are:
839 # - Allow anonymous users to register 846 # - Allow anonymous users to register
840 p = db.security.getPermission('Create', 'user') 847 db.security.addPermissionToRole('Anonymous', 'Create', 'user')
841 db.security.addPermissionToRole('Anonymous', p)
842 848
843 # Allow anonymous users access to view issues (and the related, linked 849 # Allow anonymous users access to view issues (and the related, linked
844 # information) 850 # information)
845 for cl in 'issue', 'file', 'msg', 'keyword', 'priority', 'status': 851 for cl in 'issue', 'file', 'msg', 'keyword', 'priority', 'status':
846 p = db.security.getPermission('View', cl) 852 db.security.addPermissionToRole('Anonymous', 'View', cl)
847 db.security.addPermissionToRole('Anonymous', p)
848 853
849 # [OPTIONAL] 854 # [OPTIONAL]
850 # Allow anonymous users access to create or edit "issue" items (and the 855 # Allow anonymous users access to create or edit "issue" items (and the
851 # related file and message items) 856 # related file and message items)
852 #for cl in 'issue', 'file', 'msg': 857 #for cl in 'issue', 'file', 'msg':
853 # p = db.security.getPermission('Create', cl) 858 # db.security.addPermissionToRole('Anonymous', 'Create', cl)
854 # db.security.addPermissionToRole('Anonymous', p) 859 # db.security.addPermissionToRole('Anonymous', 'Edit', cl)
855 # p = db.security.getPermission('Edit', cl)
856 # db.security.addPermissionToRole('Anonymous', p)
857 860
858 861
859 Automatic Permission Checks 862 Automatic Permission Checks
860 --------------------------- 863 ---------------------------
861 864
884 887
885 New users are assigned the Roles defined in the config file as: 888 New users are assigned the Roles defined in the config file as:
886 889
887 - NEW_WEB_USER_ROLES 890 - NEW_WEB_USER_ROLES
888 - NEW_EMAIL_USER_ROLES 891 - NEW_EMAIL_USER_ROLES
892
893 The `users may only edit their issues`_ example shows customisation of
894 these parameters.
889 895
890 896
891 Changing Access Controls 897 Changing Access Controls
892 ------------------------ 898 ------------------------
893 899

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