50 lines
1.2 KiB
PHP
50 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\Hardware;
|
|
use App\Models\User;
|
|
|
|
class HardwarePolicy
|
|
{
|
|
/**
|
|
* Determine whether the user can view any models.
|
|
*/
|
|
public function viewAny(User $user): bool
|
|
{
|
|
return true; // Tous les agents connectés peuvent voir la liste du matériel
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can view the model.
|
|
*/
|
|
public function view(User $user, Hardware $hardware): bool
|
|
{
|
|
return true; // Tous les agents connectés peuvent voir les détails d'un équipement
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can create models.
|
|
*/
|
|
public function create(User $user): bool
|
|
{
|
|
return true; // Sylvain, Kévin et Jérémy peuvent enregistrer du matériel
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can update the model.
|
|
*/
|
|
public function update(User $user, Hardware $hardware): bool
|
|
{
|
|
return true; // Tous les agents du service technique peuvent modifier une fiche matériel
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can delete the model.
|
|
*/
|
|
public function delete(User $user, Hardware $hardware): bool
|
|
{
|
|
return true; // Tous les agents du service technique peuvent supprimer un équipement
|
|
}
|
|
}
|