2023-01-13 02:43:38 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2023-01-28 23:21:40 +01:00
|
|
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
2023-01-13 02:43:38 +01:00
|
|
|
*
|
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
|
|
|
*/
|
|
|
|
|
2023-01-18 21:54:15 +01:00
|
|
|
namespace App\Http\Requests\TaskScheduler;
|
2023-01-13 02:43:38 +01:00
|
|
|
|
|
|
|
use App\Http\Requests\Request;
|
|
|
|
|
|
|
|
class DestroySchedulerRequest extends Request
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Determine if the user is authorized to make this request.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function authorize() : bool
|
|
|
|
{
|
2023-02-24 02:16:40 +01:00
|
|
|
return auth()->user()->isAdmin() && $this->task_scheduler->company_id == auth()->user()->company()->id;
|
2023-01-13 02:43:38 +01:00
|
|
|
}
|
|
|
|
}
|