summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1623939)
raw | patch | inline | side by side (parent: 1623939)
author | kedder <kedder@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 13 Mar 2003 09:27:24 +0000 (09:27 +0000) | ||
committer | kedder <kedder@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 13 Mar 2003 09:27:24 +0000 (09:27 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1587 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/security.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index a5d04c9f0af291d5dcada3dca09162559e6c29ab..9c87f337b7a1ab7b843988d5b07e47f4f8b53d48 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- relaxed CVS importing (sf feature 693277)
- added support for searching on ranges of dates (see doc/user_guide.txt in
chapter "Searching Page" for details)
+- role names made case insensitive
Fixed:
diff --git a/roundup/security.py b/roundup/security.py
index 0526b4eb8c66e3e0730d550fc42744a7229d4cce..3c87c48cc93263466fcac678cc1321513c6da103 100644 (file)
--- a/roundup/security.py
+++ b/roundup/security.py
- permissions
'''
def __init__(self, name='', description='', permissions=None):
- self.name = name
+ self.name = name.lower()
self.description = description
if permissions is None:
permissions = []
roles = self.db.user.get(userid, 'roles')
if roles is None:
return 0
- for rolename in roles.split(','):
+ for rolename in [x.lower() for x in roles.split(',')]:
if not rolename or not self.role.has_key(rolename):
continue
# for each of the user's Roles, check the permissions
'rolename' is the name of the role to add the permission to.
'''
- role = self.role[rolename]
+ role = self.role[rolename.lower()]
role.permissions.append(permission)
# vim: set filetype=python ts=4 sw=4 et si
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index d18c8b406721b45c9f8f0580f8228cd88d005615..cfcd82f30dc2fe857eb8228cef5750cfb507f307 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test_mailgw.py,v 1.40 2003-02-28 03:33:25 richard Exp $
+# $Id: test_mailgw.py,v 1.41 2003-03-13 09:27:24 kedder Exp $
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys, difflib
def testNewUserAuthor(self):
# first without the permission
# heh... just ignore the API for a second ;)
- self.db.security.role['Anonymous'].permissions=[]
+ self.db.security.role['anonymous'].permissions=[]
anonid = self.db.user.lookup('anonymous')
self.db.user.set(anonid, roles='Anonymous')
# now with the permission
p = self.db.security.getPermission('Email Registration')
- self.db.security.role['Anonymous'].permissions=[p]
+ self.db.security.role['anonymous'].permissions=[p]
handler = self.instance.MailGW(self.instance, self.db)
handler.trapExceptions = 0
message = cStringIO.StringIO(s)