Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
strichter committed Mar 25, 2009
1 parent 72b377b commit 0582340
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/z3c/form/testing.py
Expand Up @@ -56,7 +56,8 @@ class TestingFileUploadDataConverter(converter.FileUploadDataConverter):
def toFieldValue(self, value):
if value is None or value == '':
value = self.widget.request.get(self.widget.name+'.testing', '')
encoding = self.widget.request.get(self.widget.name+'.encoding', 'plain')
encoding = self.widget.request.get(
self.widget.name+'.encoding', 'plain')

# allow for the case where the file contents are base64 encoded.
if encoding!='plain':
Expand All @@ -78,21 +79,13 @@ class SimpleSecurityPolicy(object):

def __init__(self, loggedIn=False, allowedPermissions=()):
self.loggedIn = loggedIn
self.allowedPermissions = allowedPermissions
self.allowedPermissions = allowedPermissions + (checker.CheckerPublic,)

def __call__(self, *participations):
self.participations = []
return self

def add(self, participation):
pass

def remove(self, participation):
pass

def checkPermission(self, permission, object):
if permission is checker.CheckerPublic:
return True
if self.loggedIn:
if permission in self.allowedPermissions:
return True
Expand Down

0 comments on commit 0582340

Please sign in to comment.