I need the functionality of role_watchdog for a site that also uses og_user_roles. The og_user_roles module allows group admins to add and remove certain specified roles to group members on a per-group basis. These group-specific roles are then active only in the context of that group.
If this functionality would be welcome in role_watchdog, then I will submit a patch here when it is ready. If I implemented this as a separate module, it would end up being a superset of this module, so I would prefer to just integrate with this existing code. The functionality of role_watchdog would not change, but there would be an additional "group" field in the role history page. This field would be empty for global changes, or would contain the name of the group when a change from og_user_roles was used to add a group role. The "group" field would not be displayed unless the og_user_roles module was enabled, but the group field would always be present in the role_watchdog table in the database.
Comments
Comment #2
greg.1.anderson commentedHere is a patch for the 6.x version; I can make a 7.x version once this looks acceptable. n.b. og_user_roles does not have a Drupal 7 release, but I believe that is functionality is standard in og-7.x.
The attached patch also includes the commit from #1517028: Log role changes that users make to their own account; these patches overlapped, and I did not take the time to separate them.
n.b. in order for the "admin removed" event to be logged, a patch to og is needed. Will post a link to the appropriate issue here once it is submitted.
Comment #3
greg.1.anderson commentedThe "admin remove" notification patch for og-6.x is at #1528730: Notify when group administrator rights for a group are removed.
Comment #4
greg.1.anderson commentedHere is a patch that includes all of #3, plus an additional feature: logging of blocked / unblocked users. I mixed this additional feature request in with this patch because it is tangled with the refactor of _role_watchdog_process_role_changes included herein; I could separate these if desired.
The block / unblock operation is implemented as the removal or addition of the "authenticated user" role. I felt that this feature addition was of general usefulness, so these events are always logged. It would be an easy thing to add a new preference to enable or disable the logging of user block / unblock operations, if desired.
Correcting version number to 6.x-1.x-dev. I will role a 7.x patch if the concept is acceptable.
Comment #5
greg.1.anderson commentedHere are my latest improvements to role_watchdog with og support. Includes #1408090: Provide administrative overview page, and also splits role history and role grants into two separate pages (each under "Track" instead of at the top level of the user page), with pagers added to each.
Comment #6
greg.1.anderson commentedI am refactoring #5 to separate all of the og support into a separate submodule, og_role_watchdog. Patch should be available shortly.
Comment #7
greg.1.anderson commentedNow, og_role_watchdog is split out into a separate module, found in the 'modules' subfolder of role_watchdog. It would be possible to check this in as a separate project, but I would prefer to see it bundled with role_watchdog.
Note that this patch also includes fixed for the following issues, unrelated to (but required by) og_role_watchdog:
#1517028: Log role changes that users make to their own account
#1408090: Provide administrative overview page
#1151842: [RFC] Do not rely on $account object for prior roles state
#1263032: Feature Request: add primary key to role_watchdog table so that it can be views enabled
Note that there is no clean upgrade path from the patch in #5 to this version; it is best to uninstall role_watchdog and re-install if moving from any prior patch on this issue to the factored version presented here. Upgrade paths from other versions of role_watchdog-6.x should work fine.
Comment #8
greg.1.anderson commentedHere is a 7.x-1.x version of the patch in #7. In addition to the features described above, this patch also introduces a "track role grants" tab in every group page that shows all of the role changes made only in the context of that group.
Comment #9
greg.1.anderson commentedFix incorrect access callback in group role grant report menu item.
Comment #10
greg.1.anderson commentedThe 'admin remove' notification was committed to og-6.x-2.x-dev in #1528730: Notify when group administrator rights for a group are removed; the 6.x version of og_role_watchdog will need this version of og or later in order to log removal of group administration rights. (The current version, og-6.x-2.4 does not have this commit; og-6.x-2.5 should have it, once released.)
Comment #12
greg.1.anderson commentedCommitted in the 2.0-beta1 release.