I'm trying to hide meetings from the list view when a boolean called Private is true. My understanding is I should implement an AccessControlFilter class in custom/Espo/Custom/Select/Meeting/AccessControlFilters, but it doesn't seem to be working. Here are my files:
custom/Espo/Custom/Classes/Select/Meeting/AccessControlFilters/HidePrivate.php:
custom/Espo/Custom/Resources/metadata/selectDefs/Meeting.json:
After rebuilding and refreshing, I was expecting to see "HidePrivate" in the log whenever a list of meetings is loaded in the list view. However, nothing is displayed. What am I doing wrong?
custom/Espo/Custom/Classes/Select/Meeting/AccessControlFilters/HidePrivate.php:
PHP Code:
<?php
namespace Espo\Custom\Classes\Select\Meeting\AccessControlFilters;
use Espp\Core\Select\AccessControl\Filter;
use Espo\ORM\Query\SelectBuilder;
use Espo\Entities\User;
class HidePrivate implements Filter
{
public function __construct(
private User $user,
) {}
public function apply(SelectBuilder $queryBuilder): void {
$GLOBALS["log"]->debug("HidePrivate",[]);
}
}
PHP Code:
{
"accessControlFilterClassNameMap": {
"hidePrivate": "Espo\\Custom\\Classes\\Select\\Meeting\\AccessControlFilters\\HidePrivate"
}
}
Comment