Answers.Body: <p>UPDATE: Will be fixed in 5.36.0</p>
  <hr />
  <p><a href="https://lab.civicrm.org/dev/core/issues/1400" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/issues/1400</a></p>
  <p>You can work around it by changing this line: <a href="https://github.com/civicrm/civicrm-core/blob/5.19.1/CRM/Case/BAO/Case.php#L541" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/blob/5.19.1/CRM/Case/BAO/Case.php#L541</a></p>
  <p>from</p>
  <p><code>if (empty($params['status_id']) &amp;&amp; ($type == 'upcoming' || $type == 'any')) {</code></p>
  <p>to</p>
  <p><code>if (empty($params['status_id']) &amp;&amp; ($type == 'upcoming')) {</code></p>
  <p>but that might cause closed cases to start appearing or being counted differently than now.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-16T20:11:31.340Z
Answers.LastActivityDate: 2021-03-02T14:15:31.383Z
Answers.LastEditDate: 2021-03-02T14:15:31.383Z
Answers.UserDisplayName: Demerit
Body: <p>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.</p>
  
  <p>Users with 'view all cases' can access resolved cases as normal.</p>
  
  <p>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.</p>
  
  <p>Running CiviCRM 5.19.1 and latest Drupal.</p>
  
  <pre><code>Nov 16 00:39:28  [error] $Fatal Error Details = Array
  (
      [message] =&gt; You are not authorized to access this page.
      [code] =&gt;
  )
  
  
  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-&gt;preProcess()
  #3 .../public/sites/all/modules/civicrm/CRM/Core/Invoke.php(290): CRM_Case_Page_Tab-&gt;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}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-16T02:49:03.053Z
Comments.Text: It's not intentional - there are currently some known issues with closed cases, although this one sounds new.
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-16T13:33:00.103Z
Comments.Text: I'll submit it as a bug then. Thanks - was going a bit crazy there!
Comments.UserDisplayName: termdark
Tags: <civicase>
Title: Users with 'view own cases' permission can't access resolved cases
ThreadText: # Users with 'view own cases' permission can't access resolved cases
  
  (Asked by: username_0 on 2019-11-16)
  
  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}
  
  ```
  
  **Tags:** civicase
  
  > **Comments:**
  > **username_1**: It's not intentional - there are currently some known issues with closed cases, although this one sounds new.  
  > **username_0**: I'll submit it as a bug then. Thanks - was going a bit crazy there!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-11-16. Score: 2 | Accepted answer
  
  UPDATE: Will be fixed in 5.36.0
  
  ---
  
  <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.
  
  
  ---
  
  