comparison roundup/mailgw.py @ 902:b0d3d3535998

Bugger it. Here's the current shape of the new security implementation. Still to do: . call the security funcs from cgi and mailgw . change shipped templates to include correct initialisation and remove the old config vars ... that seems like a lot. The bulk of the work has been done though. Honest :)
author Richard Jones <richard@users.sourceforge.net>
date Thu, 25 Jul 2002 07:14:06 +0000
parents de3da99a7c02
children 502a5ae11cc5
comparison
equal deleted inserted replaced
901:31a62bcb9c80 902:b0d3d3535998
71 set() method to add the message to the item's spool; in the second case we 71 set() method to add the message to the item's spool; in the second case we
72 are calling the create() method to create a new node). If an auditor raises 72 are calling the create() method to create a new node). If an auditor raises
73 an exception, the original message is bounced back to the sender with the 73 an exception, the original message is bounced back to the sender with the
74 explanatory message given in the exception. 74 explanatory message given in the exception.
75 75
76 $Id: mailgw.py,v 1.77 2002-07-18 11:17:31 gmcm Exp $ 76 $Id: mailgw.py,v 1.78 2002-07-25 07:14:06 richard Exp $
77 ''' 77 '''
78 78
79 79
80 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri 80 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
81 import time, random 81 import time, random
93 class MailUsageHelp(Exception): 93 class MailUsageHelp(Exception):
94 pass 94 pass
95 95
96 class UnAuthorized(Exception): 96 class UnAuthorized(Exception):
97 """ Access denied """ 97 """ Access denied """
98
99 def initialiseSecurity(security):
100 ''' Create some Permissions and Roles on the security object
101
102 This function is directly invoked by security.Security.__init__()
103 as a part of the Security object instantiation.
104 '''
105 newid = security.addPermission(name="Email Registration",
106 description="Anonymous may register through e-mail")
107 security.addPermissionToRole('Anonymous', newid)
98 108
99 class Message(mimetools.Message): 109 class Message(mimetools.Message):
100 ''' subclass mimetools.Message so we can retrieve the parts of the 110 ''' subclass mimetools.Message so we can retrieve the parts of the
101 message... 111 message...
102 ''' 112 '''
788 content = '\n\n'.join(l) 798 content = '\n\n'.join(l)
789 return summary, content 799 return summary, content
790 800
791 # 801 #
792 # $Log: not supported by cvs2svn $ 802 # $Log: not supported by cvs2svn $
803 # Revision 1.77 2002/07/18 11:17:31 gmcm
804 # Add Number and Boolean types to hyperdb.
805 # Add conversion cases to web, mail & admin interfaces.
806 # Add storage/serialization cases to back_anydbm & back_metakit.
807 #
793 # Revision 1.76 2002/07/10 06:39:37 richard 808 # Revision 1.76 2002/07/10 06:39:37 richard
794 # . made mailgw handle set and modify operations on multilinks (bug #579094) 809 # . made mailgw handle set and modify operations on multilinks (bug #579094)
795 # 810 #
796 # Revision 1.75 2002/07/09 01:21:24 richard 811 # Revision 1.75 2002/07/09 01:21:24 richard
797 # Added ability for unit tests to turn off exception handling in mailgw so 812 # Added ability for unit tests to turn off exception handling in mailgw so

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