Answers.Body: <p>Perhaps enhance core to provide a 'CiviCRM: edit activities' permission. I don't think it would be that difficult. We're currently adding permissions based on financial types of objects in contributions (like line items, premiums, etc) and it isn't that bad. With an edit permission you don't have to worry about reports, etc.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-14T06:16:09.117Z
Answers.Text: We have actually used a specific permission for this action, but we still had to enhance the core jQuery part. But IMO it is certainly the most 'structured' approach :-)
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-14T13:40:28.200Z
Answers.Text: Great, @ErikH. This is of general interest to my mind and would be good to package as an extension or submit to core as a PR.
Answers.UserDisplayName: Joe Murray
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-15T16:37:57.423Z
Answers.Text: I agree. The change we did is very specific so we would need to generalise it. But I will put it on my 'to do at the next sprint or community development moment' list :-)
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-09T20:06:33.383Z
Answers.LastActivityDate: 2015-04-09T20:06:33.383Z
Answers.UserDisplayName: Joe Murray
Body: <p>The use case is that every user should see their cases and their activities, but only certain users (based on their Drupal roles and permissions) should be able to change the status of some activities. The build up of the activities in the case summary form/page is not done in advance and does not show up in the buildForm hook. It is a jQuery datatable with a source url that is linked to CRM_Case_BAO_Case::getCaseActivity. What I have done is create a page in my extension and replace the sourceURL in the datatable with one in my extension, and in the callback replace the core method CRM_Case_BAO_Case::getCaseActivity with my own specific one. Any suggestion for another / better method?</p>
  
Tags: <extension><civicase>
Title: Is it possible to prevent a certain role from changing the activity status in a case activity?
ThreadText: # Is it possible to prevent a certain role from changing the activity status in a case activity?
  
  (Asked by: username_0 on 2015-04-07)
  
  The use case is that every user should see their cases and their activities, but only certain users (based on their Drupal roles and permissions) should be able to change the status of some activities. The build up of the activities in the case summary form/page is not done in advance and does not show up in the buildForm hook. It is a jQuery datatable with a source url that is linked to CRM\_Case\_BAO\_Case::getCaseActivity. What I have done is create a page in my extension and replace the sourceURL in the datatable with one in my extension, and in the callback replace the core method CRM\_Case\_BAO\_Case::getCaseActivity with my own specific one. Any suggestion for another / better method?
  
  **Tags:** extension, civicase
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-04-09. Score: 2
  
  Perhaps enhance core to provide a 'CiviCRM: edit activities' permission. I don't think it would be that difficult. We're currently adding permissions based on financial types of objects in contributions (like line items, premiums, etc) and it isn't that bad. With an edit permission you don't have to worry about reports, etc.
  
  > **Comments:**
  > **username_0**: We have actually used a specific permission for this action, but we still had to enhance the core jQuery part. But IMO it is certainly the most 'structured' approach :-)  
  > **username_1**: Great, @username_0. This is of general interest to my mind and would be good to package as an extension or submit to core as a PR.  
  > **username_0**: I agree. The change we did is very specific so we would need to generalise it. But I will put it on my 'to do at the next sprint or community development moment' list :-)  
  
  ---
  
  