I want to create dynamic capabilities using WP_Role::add_cap(), something like
$author_role = get_role('author');
foreach ($sections as $section) {
$author_role->add_cap( "edit_{$section}_pages", /* grant= */ false );
}
and then let administrators grant certain of those capabilities to certain authors only (e.g., Jane can edit_school_pages) in wp-admin (not programmatically, via WP_User::add_cap()).
I assume a plugin can help with this, but those I’ve found (e.g., Capability Manager) seem to emphasize creating new Roles or Capabilities and adding/moving Capabilities among Roles, not granting capabilities directly to users (though I could be wrong).
Advice? Thanks, s