‪TYPO3CMS  ‪main
AbstractWizardController.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;
24 
30 {
38  protected function ‪checkEditAccess($table, ‪$uid)
39  {
40  ‪$record = BackendUtility::getRecordWSOL($table, ‪$uid);
41  if (is_array(‪$record)) {
42  // If pages:
43  if ($table === 'pages') {
44  $calculatedPermissions = new ‪Permission($this->‪getBackendUserAuthentication()->calcPerms(‪$record));
45  $hasAccess = $calculatedPermissions->editPagePermissionIsGranted();
46  } else {
47  // Fetching pid-record first.
48  $calculatedPermissions = new ‪Permission($this->‪getBackendUserAuthentication()->calcPerms(
49  BackendUtility::getRecord('pages', ‪$record['pid'])
50  ));
51  $hasAccess = $calculatedPermissions->editContentPermissionIsGranted();
52  }
53  // Check internals regarding access:
54  if ($hasAccess) {
55  $hasAccess = $this->‪getBackendUserAuthentication()->recordEditAccessInternals($table, ‪$record);
56  }
57  } else {
58  $hasAccess = false;
59  }
60  return (bool)$hasAccess;
61  }
62 
64  {
65  return ‪$GLOBALS['BE_USER'];
66  }
67 
69  {
70  return ‪$GLOBALS['LANG'];
71  }
72 }
‪TYPO3\CMS\Backend\Controller\Wizard\AbstractWizardController\getBackendUserAuthentication
‪getBackendUserAuthentication()
Definition: AbstractWizardController.php:63
‪TYPO3\CMS\Backend\Controller\Wizard\AbstractWizardController
Definition: AbstractWizardController.php:30
‪TYPO3\CMS\Backend\Controller\Wizard\AbstractWizardController\getLanguageService
‪getLanguageService()
Definition: AbstractWizardController.php:68
‪TYPO3\CMS\Core\Type\Bitmask\Permission
Definition: Permission.php:26
‪TYPO3\CMS\Backend\Controller\Wizard
Definition: AbstractWizardController.php:18
‪TYPO3\CMS\Webhooks\Message\$record
‪identifier readonly int readonly array $record
Definition: PageModificationMessage.php:36
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:66
‪TYPO3\CMS\Backend\Controller\Wizard\AbstractWizardController\checkEditAccess
‪bool checkEditAccess($table, $uid)
Definition: AbstractWizardController.php:38
‪TYPO3\CMS\Webhooks\Message\$uid
‪identifier readonly int $uid
Definition: PageModificationMessage.php:35
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:46