Index: main/waeup.sirp/trunk/src/waeup/sirp/jambtables/util.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/jambtables/util.py	(revision 5444)
+++ main/waeup.sirp/trunk/src/waeup/sirp/jambtables/util.py	(revision 5445)
@@ -45,2 +45,21 @@
     # XXX: Maybe we have to mark reg_no as used here?
     return (applicant_data, entries[0])
+
+def get_access_code(access_code):
+    """Get an access code instance.
+
+    Returns ``None`` if the given code cannot be found.
+
+    XXX: This should be moved to `accesscodes` as public API part.
+    """
+    site = grok.getSite()
+    if not isinstance(access_code, basestring):
+        return None
+    try:
+        batch_id, ac_id = access_code.rsplit('-', 1)
+    except:
+        return None
+    if batch_id not in site['accesscodes'].keys():
+        return None
+    batch = site['accesscodes'][batch_id]
+    return batch.getAccessCode(access_code)
