1

I suspect the answer is 'you'll have to code it...', but SearchKit has advanced so rapidly, I thought it was worth asking the question.

I have a search form that I need to secure for a certain group of users. ACLs do just about everything I need along with Drupal permissions/roles. I want to be able to control access to a SearchKit form, but the only way I can do this by the looks of it is to choose a particular CiviCRM permission?

The ideal way would be to make it consistent with the rest of CiviCRM and control it through ACLs - at the moment you can choose to secure groups of contacts, profiles, custom data and events, but not unfortunately anything related to SearchKit/Afform.

So do I have use a hook_civicrm_permission to create the particular permissions I need?

1 Answer 1

2

I think you are correct that SearchKit permissions don't integrate with ACL's yet.

Maybe you could create a permission for your form, grant it to your Drupal role and configure SK to use it. I don't think your extension would need to do anything more than define the permission with hook_civicrm_permission().

2
  • Thanks Aidan - I thought this might be the case. I'll do just that. Does anyone know if this is on the roadmap?
    – ChumKui
    Commented Mar 30, 2023 at 12:59
  • It's not on lab.civicrm.org/dev/core/-/issues/3761 I suggest you create a core issue ticket for an 'improvement' and then add it to the end of the 'Other improvements' section of 3761. One possible way to address it (if this permissions approach works) is to provide an option on FB to generate a unique permission, similar to the way it can create menu links.
    – Aidan
    Commented Mar 30, 2023 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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