Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • WordPress WordPress
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 23
    • Issues 23
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • DevelopmentDevelopment
  • WordPressWordPress
  • Issues
  • #69

Add support for Capability Manager

As mentioned in #68 we're a bit nervous of the WordPress Access Control page. instead we use PublishPress Capabilities, which used to be Capability Manager (and something before that, I think). It's got about 90k installations. It shows all the WP capabilities for a given role, but one role at a time - so avoiding issues with max_input_vars.

By default the Civi capabilities are mixed in with 'Additional Capabilities', which makes it hard to tell them apart from capabilities added by other plugins:

image

So we added a filter which separates it out:

image

It's a few lines:

function add_civicrm_category_to_capability_manager($capabilities) {
  civicrm_initialize();
  $permissions = array_keys(CRM_ACL_Form_WordPress_Permissions::getPermissionArray());
  sort($permissions);
  capabilities['CiviCRM'] = $permissions;
  return capabilities;
}
add_filter('cme_plugin_capabilities','add_civicrm_category_to_capability_manager',10,1);

Is this too specific to add to Core?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking