Index: og_user_roles.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/og_user_roles/og_user_roles.module,v
retrieving revision 1.35
diff -u -p -r1.35 og_user_roles.module
--- og_user_roles.module	26 May 2009 05:35:06 -0000	1.35
+++ og_user_roles.module	8 Jun 2009 00:54:36 -0000
@@ -93,16 +93,24 @@ function og_user_roles_theme() {
 /**
  * Implementation of hook_init().
  *
- * OG invokes menu_get_item() in og_determine_context() via og_init(), which
- * performs the very first access check for the current path and is irreversible
- * (statically cached). Since we want to alter the user's roles, we need to
- * invoke a fork of og_determine_context(), which does not use the menu system,
- * but still retrieves the current group context, so we can properly assign
- * additional roles for the user.
- *
- * This is only possible, since we decreased the module weight of og_user_roles
- * to have our hook run first. hook_boot() cannot be used, because the path is
- * not yet initialized there.
+ * In og_init(), Organic Groups invokes menu_get_item() via
+ * og_determine_context(). menu_get_item() performs an access check for the
+ * current path, which is irreversible (statically cached). Since we want to
+ * alter the user's roles before the rest of the system (especially the menu
+ * system) performs access checks, we need to invoke a fork of
+ * og_determine_context(), which uses custom implementations of menu_get_item()
+ * and menu_get_object() to retrieve the current group context, so we can
+ * properly assign additional roles for the user. After this manipulation, the
+ * rest of the system behaves as usual - i.e. og_init() consults the menu system
+ * to determine the context, and if the additional user roles allow access to
+ * the current path, the menu system will allow access and cache that
+ * statically.
+ *
+ * This manipulation is only possible, since we decreased the module weight of
+ * og_user_roles, so og_user_roles_init() runs before og_init() and probably
+ * before most other implementations of hook_init().
+ * hook_boot() cannot be used, because the path system is not yet initialized
+ * there.
  *
  * @see og_determine_context()
  * @see og_user_roles_determine_context()
