1

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?

1 Answer 1

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.

3
  • 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 :-) Apr 14, 2015 at 6:16
  • 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.
    – Joe Murray
    Apr 14, 2015 at 13:40
  • 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 :-) Apr 15, 2015 at 16:37

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.