Skip to content

Commit

Permalink
Remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
billtomczak committed Jun 13, 2023
1 parent de5590f commit ead16b2
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/admin/library/Free/Helper/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,37 +133,6 @@ public static function isLocalPath(?string $path): bool
return File::exists(realpath(JPATH_SITE . '/' . ltrim($path, '/')));
}

/**
* Get the files the user has access to, filtering or not by the externalRef.
*
* @param ?int $userId
* @param ?string $externalRef
*
* @return array
*/
public static function getAuthorizedFilesForUser(?int $userId, ?string $externalRef = ''): array
{
// Flush any Access cache
Access::clearStatics();

$authorizedViewLevels = Access::getAuthorisedViewLevels($userId);
$authorizedViewLevels = implode(',', $authorizedViewLevels);

// Get the files the user has access to and external ref has the suffix .pro
$db = Factory::getDbo();
$query = $db->getQuery(true)
->select('*')
->from('#__osdownloads_documents')
->where("access IN ($authorizedViewLevels)");

if ($externalRef !== '') {
$query->where('external_ref LIKE "' . $externalRef . '"');
}
$db->setQuery($query);

return $db->loadObjectList();
}

/**
* @param string $fileName
* @param ?bool $isUpload
Expand Down

0 comments on commit ead16b2

Please sign in to comment.