FEATURE: add permissions into widgets and fix few bugs

This commit is contained in:
Michal Kváček
2017-08-24 01:54:58 +02:00
parent e0f5cba9a4
commit b35149ad67
23 changed files with 239 additions and 110 deletions
+7
View File
@@ -1,7 +1,9 @@
<?php
namespace App\CMS\Handlers\Search;
use App\Models\FileManager\File;
use Illuminate\Support\Collection;
class Files extends Search
{
@@ -24,6 +26,11 @@ class Files extends Search
*/
public function search($term)
{
if (\Auth::user()
->cannot('manage', File::class)) {
return new Collection();
}
$token = $this->tokenize($term);
return File::where('original_filename', 'LIKE', $token)