Initial commit: Import existing Laravel project
This commit is contained in:
49
app/Policies/HardwarePolicy.php
Normal file
49
app/Policies/HardwarePolicy.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user