'Test permission check with policy 1'

def testPolicy1(self):

    auth = current.auth
    current.deployment_settings.security.policy = 1
    auth.permission = S3Permission(auth)
    has_permission = auth.s3_has_permission
    tablename = 'org_permission_test'
    assertTrue = self.assertTrue
    assertFalse = self.assertFalse
    auth.s3_impersonate(None)
    permitted = has_permission('read', table=tablename)
    assertTrue(permitted)
    permitted = has_permission('update', table=tablename)
    assertFalse(permitted)
    auth.s3_impersonate('normaluser@example.com')
    permitted = has_permission('read', table=tablename)
    assertTrue(permitted)
    permitted = has_permission('update', table=tablename)
    assertTrue(permitted)
