Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
W
WordPress
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 19
    • Issues 19
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Development
  • WordPress
  • Issues
  • #69

Closed
Open
Opened Jul 29, 2020 by Andrew West@awestbha

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 admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/wordpress#69