Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 28a6741

Browse files
committed
Correctly check the permission to move child records as non-admin user
1 parent f538903 commit 28a6741

File tree

6 files changed

+12
-5
lines changed

6 files changed

+12
-5
lines changed

system/docs/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Contao Open Source CMS changelog
22
================================
33

4+
Version 3.5.38 (2018-12-XX)
5+
---------------------------
6+
7+
### Fixed
8+
Correctly check the permission to move child records as non-admin user.
9+
10+
411
Version 3.5.37 (2018-12-13)
512
---------------------------
613

system/modules/calendar/dca/tl_calendar_events.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ public function checkPermission()
560560
{
561561
case 'paste':
562562
case 'select':
563-
if (!in_array($id, $root))
563+
if (!in_array(CURRENT_ID, $root)) // check CURRENT_ID here (see #247)
564564
{
565565
$this->log('Not enough permissions to access calendar ID "'.$id.'"', __METHOD__, TL_ERROR);
566566
$this->redirect('contao/main.php?act=error');

system/modules/core/dca/tl_form_field.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ public function checkPermission()
467467
{
468468
case 'paste':
469469
case 'select':
470-
if (!in_array($id, $root))
470+
if (!in_array(CURRENT_ID, $root)) // check CURRENT_ID here (see #247)
471471
{
472472
$this->log('Not enough permissions to access form ID "'.$id.'"', __METHOD__, TL_ERROR);
473473
$this->redirect('contao/main.php?act=error');

system/modules/news/dca/tl_news.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ public function checkPermission()
508508
{
509509
case 'paste':
510510
case 'select':
511-
if (!in_array($id, $root))
511+
if (!in_array(CURRENT_ID, $root)) // check CURRENT_ID here (see #247)
512512
{
513513
$this->log('Not enough permissions to access news archive ID "'.$id.'"', __METHOD__, TL_ERROR);
514514
$this->redirect('contao/main.php?act=error');

system/modules/newsletter/dca/tl_newsletter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ public function checkPermission()
310310
{
311311
case 'paste':
312312
case 'select':
313-
if (!in_array($id, $root))
313+
if (!in_array(CURRENT_ID, $root)) // check CURRENT_ID here (see #247)
314314
{
315315
$this->log('Not enough permissions to access newsletter channel ID "'.$id.'"', __METHOD__, TL_ERROR);
316316
$this->redirect('contao/main.php?act=error');

system/modules/newsletter/dca/tl_newsletter_recipients.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public function checkPermission()
246246
{
247247
case 'paste':
248248
case 'select':
249-
if (!in_array($id, $root))
249+
if (!in_array(CURRENT_ID, $root)) // check CURRENT_ID here (see #247)
250250
{
251251
$this->log('Not enough permissions to access newsletter channel ID "'.$id.'"', __METHOD__, TL_ERROR);
252252
$this->redirect('contao/main.php?act=error');

0 commit comments

Comments
 (0)