commit21
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Policies;
|
||||
use App\Enums\PurchasingRole;
|
||||
use App\Models\Supplier;
|
||||
use App\Models\User;
|
||||
use App\Services\SupplierParticipation;
|
||||
|
||||
class SupplierPolicy
|
||||
{
|
||||
@@ -20,7 +21,7 @@ class SupplierPolicy
|
||||
|
||||
public function update(User $user, Supplier $supplier): bool
|
||||
{
|
||||
return $user->hasFunctions([PurchasingRole::Procurement]) && $user->tenant_id === $supplier->tenant_id;
|
||||
return app(SupplierParticipation::class)->canPrepare($user) && $user->tenant_id === $supplier->tenant_id;
|
||||
}
|
||||
|
||||
public function viewDocuments(User $user, Supplier $supplier): bool
|
||||
|
||||
Reference in New Issue
Block a user