Fix a bug if you have no roles at all
authorSverre Rabbelier <srabbelier@gmail.com>
Sat, 14 Feb 2009 14:10:56 +0000
changeset 1309 ba51a0cd311d
parent 1308 35b75ffcbb37
child 1310 a3f654f30fbc
Fix a bug if you have no roles at all This could not happen currently, but might happen later on if a group is defined that does not have an 'anybody' membership. Patch by: Sverre Rabbelier
app/soc/views/helper/access.py
--- a/app/soc/views/helper/access.py	Fri Feb 13 23:18:39 2009 +0000
+++ b/app/soc/views/helper/access.py	Sat Feb 14 14:10:56 2009 +0000
@@ -967,6 +967,9 @@
       if self.hasMembership(value, django_args):
         roles.append(key)
 
+    if not roles:
+      roles = ['deny']
+
     get_args.setlist('read_access', roles)
     get_args._mutable = mutable