Back to index

plone3  3.1.7
Public Member Functions
CMFCore.tests.base.security.PermissiveSecurityPolicy Class Reference

List of all members.

Public Member Functions

def validate
def checkPermission

Detailed Description

    Very permissive security policy for unit testing purposes.

Definition at line 22 of file security.py.


Member Function Documentation

def CMFCore.tests.base.security.PermissiveSecurityPolicy.checkPermission (   self,
  permission,
  object,
  context 
)

Definition at line 43 of file security.py.

00043 
00044     def checkPermission(self, permission, object, context):
00045         if permission == 'forbidden permission':
00046             return 0
00047         if permission == 'addFoo':
00048             return context.user.allowed(object, ['FooAdder'])
00049         roles = rolesForPermissionOn(permission, object)
00050         if isinstance(roles, basestring):
00051             roles=[roles]
00052         return context.user.allowed(object, roles)
00053 

Here is the caller graph for this function:

def CMFCore.tests.base.security.PermissiveSecurityPolicy.validate (   self,
  accessed = None,
  container = None,
  name = None,
  value = None,
  context = None,
  roles = None,
  args,
  kw 
)

Definition at line 37 of file security.py.

00037 
00038                 , **kw):
00039         if name and name.startswith('hidden'):
00040             return False
00041         else:
00042             return True

Here is the caller graph for this function:


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