def __init__(self): """Initialization """ super(Publisher, self).__init__() local.worker = local.Thread() local.request = local.Thread()
def set_context(user=None): """ """ local.request = local.Thread() security.set_user(user) security.set_manager(SecurityManager('somekey'))
def set_dummy_context(): """Set a dummy context for security permission checks """ local.request = local.Thread() security.set_user(None) security.set_manager(DummySecurityManager())