Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-12731

CiviCRM user capabilities not being applied

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Incomplete
    • Affects Version/s: 4.2.0
    • Fix Version/s: None
    • Component/s: WordPress Integration
    • Labels:
      None

      Description

      Civicrm unusable. Error in civicrm.php. Capabilties/Roles not getting applied. Users (including administrator) cannot update or add records. Database will allow edits/updates outside of civicrm.

      Error indicated on following line

      if ( is_array( $wp_roles->get_role( $role )->capabilities ) &&

      Complete offending function as follows:

      function wp_civicrm_capability( ){
      global $wp_roles;
      if ( ! isset( $wp_roles ) )

      { $wp_roles = new WP_Roles(); }

      //access civicrm page menu link to particular roles
      $roles = array( 'super admin', 'administrator', 'editor' );

      foreach( $roles as $role ){
      if ( is_array( $wp_roles->get_role( $role )->capabilities ) &&
      ! array_key_exists( 'access_civicrm_nav_link',
      $wp_roles->get_role( $role )->capabilities ) )

      { $wp_roles->add_cap( $role, 'access_civicrm_nav_link' ); }

      }
      }

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              bobbiemccue Bobbie McCue
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: