mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 23:04:31 -04:00
minor fixes for auth gate on destroy scheduler
This commit is contained in:
parent
b1cef2900b
commit
dd88b06bb0
@ -12,7 +12,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Factory\SchedulerFactory;
|
||||
use App\Http\Requests\Task\DestroySchedulerRequest;
|
||||
use App\Http\Requests\TaskScheduler\DestroySchedulerRequest;
|
||||
use App\Http\Requests\TaskScheduler\CreateSchedulerRequest;
|
||||
use App\Http\Requests\TaskScheduler\ShowSchedulerRequest;
|
||||
use App\Http\Requests\TaskScheduler\StoreSchedulerRequest;
|
||||
|
@ -22,6 +22,6 @@ class DestroySchedulerRequest extends Request
|
||||
*/
|
||||
public function authorize() : bool
|
||||
{
|
||||
return auth()->user()->isAdmin();
|
||||
return auth()->user()->isAdmin() && $this->task_scheduler->company_id == auth()->user()->company()->id;
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ class StripePaymentDriver extends BaseDriver
|
||||
|
||||
if ($this->client
|
||||
&& isset($this->client->country)
|
||||
&& in_array($this->client->country->iso_3166_3, ['USA'])
|
||||
&& (in_array($this->client->country->iso_3166_3, ['USA']) || ($this->client->gateway_tokens()->where('gateway_type_id', GatewayType::BANK_TRANSFER)->exists()))
|
||||
) {
|
||||
$types[] = GatewayType::BANK_TRANSFER;
|
||||
}
|
||||
@ -843,15 +843,6 @@ class StripePaymentDriver extends BaseDriver
|
||||
$this->client = ClientGatewayToken::where('gateway_customer_reference', $customer)->client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pull all client payment methods and update
|
||||
* the respective tokens in the system.
|
||||
*/
|
||||
public function updateAllPaymentMethods()
|
||||
{
|
||||
return (new UpdatePaymentMethods($this))->run();
|
||||
}
|
||||
|
||||
/**
|
||||
* Imports stripe customers and their payment methods
|
||||
* Matches users in the system based on the $match_on_record
|
||||
|
Loading…
x
Reference in New Issue
Block a user