Skip to content

Commit

Permalink
PRG: 42037, check for target_ref_id as well as for access
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaagen authored and klees committed Oct 10, 2024
1 parent 329e746 commit 5cbd49c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

declare(strict_types=1);

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
Expand All @@ -18,6 +16,8 @@
*
*********************************************************************/

declare(strict_types=1);

class ilObjStudyProgrammeReferenceAccess extends ilContainerReferenceAccess
{
/**
Expand Down Expand Up @@ -45,7 +45,7 @@ public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_use
case 'visible':
case 'read':
$target_ref_id = ilContainerReference::_lookupTargetRefId($a_obj_id);
if (!$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $target_ref_id)) {
if (!$target_ref_id || !$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $target_ref_id)) {
return false;
}
break;
Expand Down

0 comments on commit 5cbd49c

Please sign in to comment.