A lot of things.

This commit is contained in:
2026-05-27 21:24:38 +02:00
parent b361f07954
commit d02baa89d6
43 changed files with 1340 additions and 231 deletions

View File

@@ -14,8 +14,11 @@ class StoreEntryRequest extends FormRequest
*/
public function authorize(): bool
{
// TODO: Change it by role.
return true;
$entry = $this->route('entry');
if( $entry )
return $this->user()->can('update', $entry);
return $this->user()->can('create', '\App\Models\Entry');
}
/**

View File

@@ -2,6 +2,7 @@
namespace App\Http\Requests;
use App\Services\TemporaryFileService;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
@@ -12,7 +13,7 @@ class TemporaryFileUploadRequest extends FormRequest
*/
public function authorize(): bool
{
return true;
return $this->user()->can('create', TemporaryFileService::class );
}
/**