‪TYPO3CMS  ‪main
BackendUserGroupIntegrityCheck.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use TYPO3\CMS\Backend\Utility\BackendUtility;
22 use ‪TYPO3\CMS\Core\SysLog\Action\Database as SystemLogDatabaseAction;
23 use ‪TYPO3\CMS\Core\SysLog\Error as SystemLogErrorClassification;
25 
31 {
32  public function ‪processDatamap_afterDatabaseOperations($status, $table, $id, $fieldArray, ‪DataHandler $dataHandler): void
33  {
34  if ($table !== 'be_groups') {
35  return;
36  }
37  $backendUserGroup = BackendUtility::getRecord($table, $id, 'explicit_allowdeny');
38  $explicitAllowDenyFields = ‪GeneralUtility::trimExplode(',', $backendUserGroup['explicit_allowdeny'] ?? '');
39  foreach ($explicitAllowDenyFields as $value) {
40  if ($value !== '' && str_starts_with($value, 'tt_content:list_type:')) {
41  if (!in_array('tt_content:CType:list', $explicitAllowDenyFields, true)) {
42  $dataHandler->‪log(
43  $table,
44  $id,
45  SystemLogDatabaseAction::UPDATE,
46  0,
47  SystemLogErrorClassification::WARNING,
48  'Editing of at least one plugin was enabled but editing the page content type "Insert Plugin" is still disallowed. Group members won\'t be able to edit plugins unless you activate editing for the content type.',
49  );
50  }
51  return;
52  }
53  }
54  }
55 }
‪TYPO3\CMS\Core\DataHandling\DataHandler
Definition: DataHandler.php:94
‪TYPO3\CMS\Core\SysLog\Action\Database
Definition: Database.php:24
‪TYPO3\CMS\Core\Hooks\BackendUserGroupIntegrityCheck\processDatamap_afterDatabaseOperations
‪processDatamap_afterDatabaseOperations($status, $table, $id, $fieldArray, DataHandler $dataHandler)
Definition: BackendUserGroupIntegrityCheck.php:32
‪TYPO3\CMS\Core\SysLog\Error
Definition: Error.php:24
‪TYPO3\CMS\Core\Hooks\BackendUserGroupIntegrityCheck
Definition: BackendUserGroupIntegrityCheck.php:31
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Core\DataHandling\DataHandler\log
‪int log($table, $recuid, $action, $recpid, $error, $details, $details_nr=-1, $data=[], $event_pid=-1, $NEWid='')
Definition: DataHandler.php:9133
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static list< string > trimExplode(string $delim, string $string, bool $removeEmptyValues=false, int $limit=0)
Definition: GeneralUtility.php:822
‪TYPO3\CMS\Core\Hooks
Definition: BackendUserGroupIntegrityCheck.php:18