Skip to content

Commit

Permalink
Merge branch '2.7' into 2
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Aug 31, 2022
2 parents bbb62b3 + 4810235 commit cf15383
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,24 @@ public function updateGrant(bool &$grant, ?File $record = null, ?array $args = n
if ($grant) {
return;
}
$session = $session = Controller::curr()->getRequest()->getSession();
if (!Controller::has_curr()) {
return;
}

$session = Controller::curr()->getRequest()->getSession();

if (!$session) {
return;
}

if (!ShareDraftController::getIsViewingPreview()) {
return;
}

if (!$record && $args) {
$record = FileShortcodeProvider::find_shortcode_record($args);
}

if ($record) {
$grant = !$record->hasRestrictedAccess();
}
Expand Down

0 comments on commit cf15383

Please sign in to comment.