Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Users without administer CiviCRM are unable to view CiviCases #61

Conversation

reecebenson
Copy link

This fixes a reproducible bug whilst using the Outlook API Extension (disabling this extension fixes the issue). The client had users who were unable to view cases and were presented with the error:

CiviCRM_API3_Exception: "API permission check failed for Activity/getcount call; insufficient permission: require administer CiviCRM"

When it stated the permission didn't have "administer CiviCRM", it was either going to be a Core bug or an extension interfering with it. Quick search lead to this extension overriding permissions (see changes for the fix).

Expected Outcome

Be able to view cases whilst the Outlook API extension is enabled.

Actual Outcome

Presented with the above error, and following traceback:

#0 /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Activity/BAO/Activity.php(950): civicrm_api3("Activity", "getcount", (Array:11))
#1 /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Activity/Selector/Activity.php(361): CRM_Activity_BAO_Activity::getActivitiesCount((Array:8))
#2 /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Selector/Controller.php(234): CRM_Activity_Selector_Activity->getTotalCount(4, "316")
#3 /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Case/Page/Tab.php(122): CRM_Core_Selector_Controller->__construct(Object(CRM_Activity_Selector_Activity), NULL, NULL, 4, Object(CRM_Case_Page_Tab), 1, NULL, "316")
#4 /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Case/Page/Tab.php(196): CRM_Case_Page_Tab->view()
#5 /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php(311): CRM_Case_Page_Tab->run((Array:4), NULL)
#6 /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php(85): CRM_Core_Invoke::runItem((Array:13))
#7 /var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#8 /var/www/html/drupal7/sites/all/modules/civicrm/drupal/civicrm.module(444): CRM_Core_Invoke::invoke((Array:4))
#9 /var/www/html/drupal7/includes/menu.inc(527): civicrm_invoke("contact", "view", "case")
#10 /var/www/html/drupal7/index.php(21): menu_execute_active_handler()
#11 {main}

URL:

Environment:

  • Drupal 7.67
  • CiviCRM 5.13.0

Cheers

@agileware-pengyi
Copy link

agileware-pengyi commented May 15, 2019

Hi @reecebenson
Thanks. This fixes my issue.

Environment:
Wordpress 5.2
CiviCRM 5.13.3

Agileware ref: CIVICRM-1205

@MegaphoneJon
Copy link

This is substantially similar to #64, but #64 resolves a second potential issue with the domain API permissions as well.

@rajeshrhino
Copy link
Collaborator

Fixed in PR #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants