‪TYPO3CMS  11.5
AbstractWizardController.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
18 use TYPO3\CMS\Backend\Utility\BackendUtility;
22 
28 {
36  protected function ‪checkEditAccess($table, $uid)
37  {
38  $record = BackendUtility::getRecordWSOL($table, $uid);
39  if (is_array($record)) {
40  // If pages:
41  if ($table === 'pages') {
42  $calculatedPermissions = new ‪Permission($this->‪getBackendUserAuthentication()->calcPerms($record));
43  $hasAccess = $calculatedPermissions->editPagePermissionIsGranted();
44  } else {
45  // Fetching pid-record first.
46  $calculatedPermissions = new ‪Permission($this->‪getBackendUserAuthentication()->calcPerms(
47  BackendUtility::getRecord('pages', $record['pid'])
48  ));
49  $hasAccess = $calculatedPermissions->editContentPermissionIsGranted();
50  }
51  // Check internals regarding access:
52  if ($hasAccess) {
53  $hasAccess = $this->‪getBackendUserAuthentication()->‪recordEditAccessInternals($table, $record);
54  }
55  } else {
56  $hasAccess = false;
57  }
58  return (bool)$hasAccess;
59  }
60 
66  protected function ‪getBackendUserAuthentication()
67  {
68  return ‪$GLOBALS['BE_USER'];
69  }
70 
76  protected function ‪getLanguageService()
77  {
78  return ‪$GLOBALS['LANG'];
79  }
80 }
‪TYPO3\CMS\Backend\Controller\Wizard\AbstractWizardController\getLanguageService
‪LanguageService getLanguageService()
Definition: AbstractWizardController.php:76
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\recordEditAccessInternals
‪bool recordEditAccessInternals($table, $idOrRow, $newRecord=false, $deletedRecord=false, $checkFullLanguageAccess=false)
Definition: BackendUserAuthentication.php:740
‪TYPO3\CMS\Backend\Controller\Wizard\AbstractWizardController
Definition: AbstractWizardController.php:28
‪TYPO3\CMS\Core\Type\Bitmask\Permission
Definition: Permission.php:26
‪TYPO3\CMS\Backend\Controller\Wizard\AbstractWizardController\getBackendUserAuthentication
‪BackendUserAuthentication getBackendUserAuthentication()
Definition: AbstractWizardController.php:66
‪TYPO3\CMS\Backend\Controller\Wizard
Definition: AbstractWizardController.php:16
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Backend\Controller\Wizard\AbstractWizardController\checkEditAccess
‪bool checkEditAccess($table, $uid)
Definition: AbstractWizardController.php:36
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42