Skip to content

Commit

Permalink
[BUGFIX] DatabaseRecordList: Set permission for "cut"
Browse files Browse the repository at this point in the history
Use `editContentPermissionIsGranted()` to calculate the permission
to cut records (except pages).

Releases: master
Related: #89465
Resolves: #92307
Change-Id: I387c486c3814c3e5b6f4959d6c725ff59562c32e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65736
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
dawind authored and lolli42 committed Sep 18, 2020
1 parent e23ed01 commit ef5d3e2
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
Expand Up @@ -2057,7 +2057,7 @@ public function makeClip($table, $row)
if ($this->clipObj->current === 'normal') {
// Show copy/cut icons:
$isSel = (string)$this->clipObj->isSelected($table, $row['uid']);
if ($isL10nOverlay || !$this->overlayEditLockPermissions($table, $row) || $isRecordDeletePlaceholder) {
if ($isL10nOverlay || $isRecordDeletePlaceholder) {
$cells['copy'] = $this->spaceIcon;
$cells['cut'] = $this->spaceIcon;
} else {
Expand Down Expand Up @@ -2086,14 +2086,11 @@ public function makeClip($table, $row)
$localCalcPerms = new Permission($this->getBackendUserAuthentication()->calcPerms(BackendUtility::getRecord('pages', $row['uid'])));
$permsEdit = $localCalcPerms->editPagePermissionIsGranted();
} else {
$permsEdit = $this->calcPerms->editContentPermissionIsGranted();
$permsEdit = $this->calcPerms->editContentPermissionIsGranted() && $this->getBackendUserAuthentication()->recordEditAccessInternals($table, $row);
}
$permsEdit = $this->overlayEditLockPermissions($table, $row, $permsEdit);

// If the listed table is 'pages' we have to request the permission settings for each page:
if ($table === 'pages') {
if ($permsEdit) {
$cells['cut'] = '<a class="btn btn-default" href="'
if ($permsEdit) {
$cells['cut'] = '<a class="btn btn-default" href="'
. htmlspecialchars($this->clipObj->selUrlDB(
$table,
$row['uid'],
Expand All @@ -2103,20 +2100,6 @@ public function makeClip($table, $row)
))
. '" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.cut')) . '">'
. $cutIcon->render() . '</a>';
} else {
$cells['cut'] = $this->spaceIcon;
}
} elseif ($this->calcPerms & Permission::CONTENT_EDIT) {
$cells['cut'] = '<a class="btn btn-default" href="'
. htmlspecialchars($this->clipObj->selUrlDB(
$table,
$row['uid'],
0,
$isSel === 'cut',
['returnUrl' => $this->listURL()]
))
. '" title="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.cut')) . '">'
. $cutIcon->render() . '</a>';
} else {
$cells['cut'] = $this->spaceIcon;
}
Expand Down

0 comments on commit ef5d3e2

Please sign in to comment.