Commit 7d09e999 authored by Benni Mack's avatar Benni Mack Committed by Georg Ringer
Browse files

[CLEANUP] Use Permission constants consistently

Instead of integers, the permission constants
should be used throughout the TYPO3 Core.

Resolves: #83383
Releases: master
Change-Id: I00c10f97fc800d9533866c98284bbd22cd1bb575
Reviewed-on: https://review.typo3.org/55156

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski's avatarTymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
parent 2cd01388
...@@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Database\ReferenceIndex; ...@@ -25,6 +25,7 @@ use TYPO3\CMS\Core\Database\ReferenceIndex;
use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Service\MarkerBasedTemplateService; use TYPO3\CMS\Core\Service\MarkerBasedTemplateService;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\ArrayUtility; use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Versioning\VersionState; use TYPO3\CMS\Core\Versioning\VersionState;
...@@ -1603,7 +1604,7 @@ class DataHandlerHook ...@@ -1603,7 +1604,7 @@ class DataHandlerHook
} }
if ($table === 'pages') { if ($table === 'pages') {
// Copy page access settings from original page to placeholder // Copy page access settings from original page to placeholder
$perms_clause = $dataHandler->BE_USER->getPagePermsClause(1); $perms_clause = $dataHandler->BE_USER->getPagePermsClause(Permission::PAGE_SHOW);
$access = BackendUtility::readPageAccess($uid, $perms_clause); $access = BackendUtility::readPageAccess($uid, $perms_clause);
$newVersion_placeholderFieldArray['perms_userid'] = $access['perms_userid']; $newVersion_placeholderFieldArray['perms_userid'] = $access['perms_userid'];
$newVersion_placeholderFieldArray['perms_groupid'] = $access['perms_groupid']; $newVersion_placeholderFieldArray['perms_groupid'] = $access['perms_groupid'];
......
...@@ -23,6 +23,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction; ...@@ -23,6 +23,7 @@ use TYPO3\CMS\Core\Database\Query\Restriction\BackendWorkspaceRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
use TYPO3\CMS\Core\Database\Query\Restriction\RootLevelRestriction; use TYPO3\CMS\Core\Database\Query\Restriction\RootLevelRestriction;
use TYPO3\CMS\Core\SingletonInterface; use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Core\Versioning\VersionState; use TYPO3\CMS\Core\Versioning\VersionState;
...@@ -519,7 +520,7 @@ class WorkspaceService implements SingletonInterface ...@@ -519,7 +520,7 @@ class WorkspaceService implements SingletonInterface
{ {
// Reusing existing functionality with the drawback that // Reusing existing functionality with the drawback that
// mount points are not covered yet // mount points are not covered yet
$perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(Permission::PAGE_SHOW);
/** @var $searchObj \TYPO3\CMS\Core\Database\QueryView */ /** @var $searchObj \TYPO3\CMS\Core\Database\QueryView */
$searchObj = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\QueryView::class); $searchObj = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\QueryView::class);
if ($pageId > 0) { if ($pageId > 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment