1

I am not understanding the meaning of 'object_role' and 'object_id' in ACL API. I was trying to manage ACL using CiviCRM API 3.

3

Object table is the type of data the ACL is operating on.

For eg: if you want to create an ACL which grants permission for an event - object table, in this case, will be civicrm_event.

Object id is the id of the event to which the permission is applied to. An example of API which uses these two params could be -

$result = civicrm_api3('Acl', 'create', [
  'object_table' => "civicrm_event",
  'object_id' => 2, //event id, 0 for all events.
]);
  • What is the use of "civicrm_saved_search" table? Because I want to give permission for one role to other groups ( View permission) using CiviCRM API. – deepak Jan 17 at 12:03
  • civicrm_saved_search table is used to store details of the smart groups created in civicrm. To give permission for a SG, i think you can directly use civicrm_group for object table and id of the smart group in object_id param. – jitendra - fuzion Jan 22 at 2:35

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.