1

I have noticed that users with the 'view own cases' Drupal permission are getting an access denied error when they try to access their own resolved cases. They can access open cases no problem.

Users with 'view all cases' can access resolved cases as normal.

Is this intentional? I've tried to replicate on the demo site, but wasn't able to create a user with that set of permissions. Unfortunately, while I've tried to make sense of the code referenced in the backtrace, it's beyond me.

Running CiviCRM 5.19.1 and latest Drupal.

Nov 16 00:39:28  [error] $Fatal Error Details = Array
(
    [message] => You are not authorized to access this page.
    [code] =>
)


Nov 16 00:39:28  [debug] $backTrace = #0 .../public/sites/all/modules/civicrm/CRM/Core/Error.php(385): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 .../public/sites/all/modules/civicrm/CRM/Case/Page/Tab.php(72): CRM_Core_Error::fatal("You are not authorized to access this page.")
#2 .../public/sites/all/modules/civicrm/CRM/Case/Page/Tab.php(188): CRM_Case_Page_Tab->preProcess()
#3 .../public/sites/all/modules/civicrm/CRM/Core/Invoke.php(290): CRM_Case_Page_Tab->run((Array:4), NULL)
#4 .../public/sites/all/modules/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#5 .../public/sites/all/modules/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#6 .../public/sites/all/modules/civicrm/drupal/civicrm.module(444): CRM_Core_Invoke::invoke((Array:4))
#7 .../public/includes/menu.inc(527): civicrm_invoke("contact", "view", "case")
#8 .../public/index.php(21): menu_execute_active_handler()
#9 {main}
  • 1
    It's not intentional - there are currently some known issues with closed cases, although this one sounds new. – Demerit Nov 16 '19 at 2:49
  • I'll submit it as a bug then. Thanks - was going a bit crazy there! – termdark Nov 16 '19 at 13:33
1

https://lab.civicrm.org/dev/core/issues/1400

You can work around it by changing this line: https://github.com/civicrm/civicrm-core/blob/5.19.1/CRM/Case/BAO/Case.php#L541

from

if (empty($params['status_id']) && ($type == 'upcoming' || $type == 'any')) {

to

if (empty($params['status_id']) && ($type == 'upcoming')) {

but that might cause closed cases to start appearing or being counted differently than now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.