Digital Sovereignty for everyone

Notes

Who may change what

  • Every ability needs BuddyPress’s bp_moderate, or being an admin of the group named in the call, so a team captain can manage their own team. BuddyPress re-checks the same thing itself on remove, ban, promote and demote.
  • Only members of the site the call runs on can be added. With LH Membership active that means an approved member, so pending applicants and unclaimed accounts are refused as not_site_member.
  • Callers with install_plugins are unrestricted: the site member requirement, site rules and the unloaded-plugin refusal are skipped for them, with a warning when site plugins were not loaded.
  • For everyone, a group always keeps an admin, and an admin must be demoted before being banned.

Site rules come first

A site’s own plugins can refuse any change through the lh_mcp_buddypress_actions_refuse_change filter: return a non-empty reason to refuse. It runs on dry runs too, so a dry run shows what a real run would refuse. Princes Park Touch uses it (in ppt-buddypress-extender) for its one team per format per night rule.

Because those rules live in plugins active on that site only, a site_id call from another site’s connector would skip them. A real change is therefore refused when the target site has plugins this call did not load, and a dry run only warns: use the site’s own connector for such changes.

Filters

  • lh_mcp_buddypress_actions_refuse_change ( $reason, $action, $user_id, $group_id, $role ): $action is add, remove, ban or set_role; return a reason string to refuse.
  • lh_mcp_buddypress_actions_is_site_member ( $is_member, $user_id, $site_id ): whether a user counts as a member of the site.

How changes are made

  • Every change goes through BuddyPress’s own functions so group hooks run: groups_join_group, groups_accept_membership_request, groups_accept_invite, groups_remove_member, groups_ban_member, groups_promote_member and groups_demote_member. The caller is passed as the group admin, as BuddyPress’s REST API does.
  • A pending membership request or invitation is accepted rather than duplicated. An unconfirmed legacy membership row is refused rather than joined over.
  • After each change the membership is read back, so a join hook that backs a join out is reported as refused.
  • The optional note is set with lh_audit_trail_set_note() just before each change and cleared after, so it attaches only to that change’s LH Audit Trail entry.

Related plugins

  • lh-mcp-buddypress-queries: the read-only companion (group members, membership status, groups, activity)
  • LH MCP Adapter Extensions: adds site_id to site-scoped abilities and returns site_notice

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.