/**
  * @param string $tableName The table name to build constraints for
  * @param string $fieldName The field name to build constraints for
  *
  * @return CompositeExpression
  */
 protected function getFrontendUserGroupConstraints(string $tableName, string $fieldName) : CompositeExpression
 {
     $expressionBuilder = $this->expressionBuilder;
     // Allow records where no group access has been configured (field values NULL, 0 or empty string)
     $constraints = [$expressionBuilder->isNull($tableName . '.' . $fieldName), $expressionBuilder->eq($tableName . '.' . $fieldName, $expressionBuilder->literal('')), $expressionBuilder->eq($tableName . '.' . $fieldName, $expressionBuilder->literal('0'))];
     foreach ($this->queryContext->getMemberGroups() as $value) {
         $constraints[] = $expressionBuilder->inSet($tableName . '.' . $fieldName, $expressionBuilder->literal((string) $value));
     }
     return $expressionBuilder->orX(...$constraints);
 }
 /**
  * @test
  */
 public function getBackendVisibilityRestrictionsWithoutRestrictions()
 {
     $this->queryContext->setContext('backend')->setAccessTime(1459706700)->setTableConfigs(['pages' => $this->defaultTableConfig])->setIncludeDeleted(true)->setIgnoreEnableFields(true);
     $subject = GeneralUtility::makeInstance(QueryRestrictionBuilder::class, ['pages' => ''], $this->expressionBuilder, $this->queryContext);
     $this->assertSame('', (string) $subject->getVisibilityConstraints());
 }
 /**
  * @test
  */
 public function getTableConfigFallsBackToTCA()
 {
     $GLOBALS['TCA']['pages']['ctrl'] = ['label' => 'title', 'tstamp' => 'tstamp', 'delete' => 'deleted', 'enablecolumns' => ['disabled' => 'hidden']];
     $this->assertSame(['delete' => 'deleted', 'enablecolumns' => ['disabled' => 'hidden']], $this->subject->getTableConfig('pages'));
 }