comparison roundup/mailgw.py @ 2649:1df7d4a41da4

Buncha stuff (sorry about the large checkin): - Permissions may now be defined on a per-property basis - added "Create" Permission. Replaces the "Web"- and "Email Registration" Permissions. - added option to turn off registration confirmation via email ("instant_registration" in config) Migrated the user edit/view permission to use check code. Fixed a buncha stuff in the default templates. Needs a thorough review though.
author Richard Jones <richard@users.sourceforge.net>
date Wed, 28 Jul 2004 02:29:46 +0000
parents 2bbcfc80ba5b
children bdf3a73dfd04
comparison
equal deleted inserted replaced
2648:fe71e108d998 2649:1df7d4a41da4
72 set() method to add the message to the item's spool; in the second case we 72 set() method to add the message to the item's spool; in the second case we
73 are calling the create() method to create a new node). If an auditor raises 73 are calling the create() method to create a new node). If an auditor raises
74 an exception, the original message is bounced back to the sender with the 74 an exception, the original message is bounced back to the sender with the
75 explanatory message given in the exception. 75 explanatory message given in the exception.
76 76
77 $Id: mailgw.py,v 1.152 2004-07-26 09:29:22 a1s Exp $ 77 $Id: mailgw.py,v 1.153 2004-07-28 02:29:45 richard Exp $
78 """ 78 """
79 __docformat__ = 'restructuredtext' 79 __docformat__ = 'restructuredtext'
80 80
81 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri 81 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
82 import time, random, sys 82 import time, random, sys
115 ''' Create some Permissions and Roles on the security object 115 ''' Create some Permissions and Roles on the security object
116 116
117 This function is directly invoked by security.Security.__init__() 117 This function is directly invoked by security.Security.__init__()
118 as a part of the Security object instantiation. 118 as a part of the Security object instantiation.
119 ''' 119 '''
120 security.addPermission(name="Email Registration",
121 description="Anonymous may register through e-mail")
122 p = security.addPermission(name="Email Access", 120 p = security.addPermission(name="Email Access",
123 description="User may use the email interface") 121 description="User may use the email interface")
124 security.addPermissionToRole('Admin', p) 122 security.addPermissionToRole('Admin', p)
125 123
126 def getparam(str, param): 124 def getparam(str, param):
762 # handle the users 760 # handle the users
763 # 761 #
764 # Don't create users if anonymous isn't allowed to register 762 # Don't create users if anonymous isn't allowed to register
765 create = 1 763 create = 1
766 anonid = self.db.user.lookup('anonymous') 764 anonid = self.db.user.lookup('anonymous')
767 if not self.db.security.hasPermission('Email Registration', anonid): 765 if not self.db.security.hasPermission('Create', 'user', anonid):
768 create = 0 766 create = 0
769 767
770 # ok, now figure out who the author is - create a new user if the 768 # ok, now figure out who the author is - create a new user if the
771 # "create" flag is true 769 # "create" flag is true
772 author = uidFromAddress(self.db, from_list[0], create=create) 770 author = uidFromAddress(self.db, from_list[0], create=create)

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