commit21
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Enums\PurchasingRole;
|
||||
use App\Models\Supplier;
|
||||
use App\Models\User;
|
||||
use App\Services\SupplierParticipation;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
@@ -11,7 +12,9 @@ class SaveSupplierRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user()?->hasFunctions([PurchasingRole::Procurement]) ?? false;
|
||||
$actor = $this->user('web');
|
||||
|
||||
return $actor instanceof User && app(SupplierParticipation::class)->canPrepare($actor);
|
||||
}
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
|
||||
Reference in New Issue
Block a user