Back to index

plone3  3.1.7
Public Member Functions
CMFPlone.tests.testSecurityDeclarations.TestAllowSendtoSecurity Class Reference
Inheritance diagram for CMFPlone.tests.testSecurityDeclarations.TestAllowSendtoSecurity:
Inheritance graph
[legend]
Collaboration diagram for CMFPlone.tests.testSecurityDeclarations.TestAllowSendtoSecurity:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_AllowSendto
def test_allowsendto_changed
def test_sendto_script_failes
def setRequestMethod
def getAuthenticator
def setupAuthenticator

Detailed Description

Definition at line 392 of file testSecurityDeclarations.py.


Member Function Documentation

Definition at line 30 of file PloneTestCase.py.

00030 
00031     def getAuthenticator(self):
00032         tag = AuthenticatorView('context', 'request').authenticator()
00033         pattern = '<input .*name="(\w+)".*value="(\w+)"'
00034         return match(pattern, tag).groups()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFPlone.tests.PloneTestCase.PloneTestCase.setRequestMethod (   self,
  method 
) [inherited]
This is a stub now, but in case you want to try
   something fancy on Your Branch (tm), put it here.

Definition at line 26 of file PloneTestCase.py.

00026 
00027     def setRequestMethod(self, method):
00028         self.app.REQUEST.set('REQUEST_METHOD', method)
00029         self.app.REQUEST.method = method

Here is the caller graph for this function:

Definition at line 35 of file PloneTestCase.py.

00035 
00036     def setupAuthenticator(self):
00037         name, token = self.getAuthenticator()
00038         self.app.REQUEST.form[name] = token
00039 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 394 of file testSecurityDeclarations.py.

00394 
00395     def test_AllowSendto(self):
00396         portal = self.portal
00397         mtool = self.portal.portal_membership
00398         checkPermission = mtool.checkPermission
00399 
00400         # should be allowed as Member
00401         self.failUnless(checkPermission(AllowSendto, portal))
00402         # should be allowed as Manager
00403         self.setRoles(['Manager'])
00404         self.failUnless(checkPermission(AllowSendto, portal))
00405         # should be allowed as anonymous
00406         self.logout()
00407         self.failUnless(checkPermission(AllowSendto, portal))

Here is the call graph for this function:

Definition at line 408 of file testSecurityDeclarations.py.

00408 
00409     def test_allowsendto_changed(self):
00410         mtool = self.portal.portal_membership
00411         checkPermission = mtool.checkPermission
00412 
00413         self.setRoles(['Manager'])
00414         self.portal.manage_permission(AllowSendto, roles=('Manager',),
00415                                       acquire=False)
00416         self.setRoles(['Member'])
00417 
00418         self.failIf(checkPermission(AllowSendto, self.portal))

Here is the call graph for this function:

Definition at line 419 of file testSecurityDeclarations.py.

00419 
00420     def test_sendto_script_failes(self):
00421         # set permission to Manager only
00422         self.setRoles(['Manager'])
00423         self.portal.manage_permission(AllowSendto, roles=('Manager',),
00424                                       acquire=False)
00425         self.setRoles(['Member'])
00426         # get sendto script in context of folder
00427         sendto = self.folder.sendto
00428         # should faile with the not allowed msg check if the msg
00429         # contains the string
00430         msg = sendto()
00431         errormsg = "You%20are%20not%20allowed%20to%20send%20this%20link"
00432         self.failIf(str(msg).find(errormsg) != -1, str(msg))
00433 

Here is the call graph for this function:


The documentation for this class was generated from the following file: