comparison test/test_security.py @ 1176:bd3b57859c37

On second thought, that last checkin was dumb. The old, nasty, for-purely-historical-reasons journaltag-as-username has gone away now. The code should handle existing journaltag-as-username entries, but will use userid from now on.
author Richard Jones <richard@users.sourceforge.net>
date Fri, 20 Sep 2002 05:08:00 +0000
parents 9b910e8d987d
children f63aa57386b0
comparison
equal deleted inserted replaced
1175:762f48bfbc0b 1176:bd3b57859c37
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 # SOFTWARE. 19 # SOFTWARE.
20 20
21 # $Id: test_security.py,v 1.4 2002-09-10 00:19:55 richard Exp $ 21 # $Id: test_security.py,v 1.5 2002-09-20 05:08:00 richard Exp $
22 22
23 import os, unittest, shutil 23 import os, unittest, shutil
24 24
25 from roundup.password import Password 25 from roundup.password import Password
26 from test_db import setupSchema, MyTestCase, config 26 from test_db import setupSchema, MyTestCase, config
30 from roundup.backends import anydbm 30 from roundup.backends import anydbm
31 # remove previous test, ignore errors 31 # remove previous test, ignore errors
32 if os.path.exists(config.DATABASE): 32 if os.path.exists(config.DATABASE):
33 shutil.rmtree(config.DATABASE) 33 shutil.rmtree(config.DATABASE)
34 os.makedirs(config.DATABASE + '/files') 34 os.makedirs(config.DATABASE + '/files')
35 self.db = anydbm.Database(config, 'test') 35 self.db = anydbm.Database(config, 'admin')
36 setupSchema(self.db, 1, anydbm) 36 setupSchema(self.db, 1, anydbm)
37 37
38 def testInterfaceSecurity(self): 38 def testInterfaceSecurity(self):
39 ' test that the CGI and mailgw have initialised security OK ' 39 ' test that the CGI and mailgw have initialised security OK '
40 # TODO: some asserts 40 # TODO: some asserts
64 ai = self.db.security.addPermission(name="View", klass="issue", 64 ai = self.db.security.addPermission(name="View", klass="issue",
65 description="User is allowed to access issues") 65 description="User is allowed to access issues")
66 self.db.security.getPermission('View', 'issue') 66 self.db.security.getPermission('View', 'issue')
67 67
68 def testDBinit(self): 68 def testDBinit(self):
69 self.db.user.create(username="admin", roles='Admin')
70 self.db.user.create(username="anonymous", roles='User') 69 self.db.user.create(username="anonymous", roles='User')
71 70
72 def testAccessControls(self): 71 def testAccessControls(self):
73 self.testDBinit() 72 self.testDBinit()
74 ei = self.db.security.addPermission(name="Edit", klass="issue", 73 ei = self.db.security.addPermission(name="Edit", klass="issue",

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