abstract class AbstractEntity {
/**
+ * @param bool $checkPermissions
* @return \Civi\Api4\Action\GetActions
*/
- public static function getActions() {
- return new \Civi\Api4\Action\GetActions(self::getEntityName(), __FUNCTION__);
+ public static function getActions($checkPermissions = TRUE) {
+ return (new \Civi\Api4\Action\GetActions(self::getEntityName(), __FUNCTION__))
+ ->setCheckPermissions($checkPermissions);
}
/**
* Magic method to return the action object for an api.
*
* @param string $action
- * @param null $args
+ * @param array $args
* @return AbstractAction
* @throws NotImplementedException
*/
$entityAction = "\\Civi\\Api4\\Action\\$entity\\" . ucfirst($action);
if (class_exists($entityAction)) {
$actionObject = new $entityAction($entity, $action);
+ if (isset($args[0]) && $args[0] === FALSE) {
+ $actionObject->setCheckPermissions(FALSE);
+ }
}
else {
throw new NotImplementedException("Api $entity $action version 4 does not exist.");