Permission Groups are feature of the PublishPress Permissions plugins. These are user groups with customizable permissions.
You can customize the permissions by several methods:
- Adding a supplemental role to a user.
- Adding exceptions to a role.
- Using Editorial Circles or Visibility Circles.
Types of groups #
There are several types of Permission Groups available:
- pp_group: groups manually created, with membership custom-defined
- pp_group (metagroup_type = wp_role): groups auto-created to correspond to the site's WordPress roles.
- pp_net_group: groups manually created and accessible to all sites on a multi-site network.
- bp_group: references to existing BuddyPress groups (Pro version only)
Functions for groups #
PublishPress Permissions provides several functions to help developers integrate with group creation, access, and membership:
- pp_create_group ( $group_vars_arr )
- pp_delete_group ( $group_id, $agent_type )
- pp_get_group ( $group_id, $agent_type = ‘pp_group' )
- pp_get_group_by_name ( $name, $agent_type = ‘pp_group' )
- pp_get_metagroup ( $metagroup_type, $metagroup_id, $args = array() )
- pp_get_groups ( $agent_type = ‘pp_group', $args = array() )
- pp_get_group_members ( $group_id, $agent_type = ‘pp_group', $cols = ‘all', $args = array() )
- pp_get_groups_for_user ( $user_id, $agent_type = ”, $args = array() )
- pp_add_group_user ( $group_id, $user_ids, $args = array() )
- pp_remove_group_user ($group_id, $user_ids, $args = array()
- pp_update_group_user ( $group_id, $user_ids, $args = array() )
Functions for roles #
PublishPress Permissions provides several functions to help developers integrate with supplemental roles and exception assignment:
- ppc_get_roles ( $agent_type, $agent_id, $args = array() )
- ppc_assign_roles ( $roles, $agent_type = ‘pp_group', $args = array() )
- ppc_get_exceptions ( $args = array() )
- ppc_assign_exceptions ( $agents, $agent_type = ‘pp_group', $args = array() )
Functions for exceptions #
Exceptions modify a user or group's permissions for specific content (category, post, page branch, etc.). These modifications may expand or reduce access.
Functions pertaining to exceptions:
- ppc_get_exceptions( $args = array() )
- ppc_assign_exceptions( $operation, $via_item_source, $for_item_source, $for_item_type, $item_id, $agents, $agent_type = ‘pp_group', $args = array() )