++ fix permessi assegnazioni
This commit is contained in:
@@ -96,6 +96,11 @@ class TerritorioIndex extends Component
|
||||
|
||||
public function toggleActive(Territorio $territorio)
|
||||
{
|
||||
// La lista è ora visibile agli utenti operativi (territori.assign), ma
|
||||
// modificare/eliminare i territori resta riservato all'amministratore.
|
||||
// Il check DEVE stare nel metodo: la rotta index non lo garantisce più.
|
||||
$this->authorize('territori.manage');
|
||||
|
||||
$territorio->update(['attivo' => !$territorio->attivo]);
|
||||
activity()->causedBy(auth()->user())
|
||||
->performedOn($territorio)
|
||||
@@ -105,6 +110,8 @@ class TerritorioIndex extends Component
|
||||
|
||||
public function togglePriority(Territorio $territorio)
|
||||
{
|
||||
$this->authorize('territori.manage');
|
||||
|
||||
$territorio->update(['prioritario' => !$territorio->prioritario]);
|
||||
activity()->causedBy(auth()->user())
|
||||
->performedOn($territorio)
|
||||
@@ -114,6 +121,8 @@ class TerritorioIndex extends Component
|
||||
|
||||
public function deleteTerritorio(Territorio $territorio)
|
||||
{
|
||||
$this->authorize('territori.manage');
|
||||
|
||||
activity()->causedBy(auth()->user())
|
||||
->performedOn($territorio)
|
||||
->log('soft_deleted');
|
||||
|
||||
Reference in New Issue
Block a user