++ fix permessi e mobile portrait
This commit is contained in:
@@ -12,6 +12,8 @@ class ProclamatoreCestino extends Component
|
||||
|
||||
public function restore(int $id)
|
||||
{
|
||||
$this->authorize('settings.manage');
|
||||
|
||||
$proclamatore = Proclamatore::onlyTrashed()->findOrFail($id);
|
||||
$proclamatore->restore();
|
||||
activity()->causedBy(auth()->user())
|
||||
@@ -22,6 +24,8 @@ class ProclamatoreCestino extends Component
|
||||
|
||||
public function forceDelete(int $id)
|
||||
{
|
||||
$this->authorize('settings.manage');
|
||||
|
||||
$proclamatore = Proclamatore::onlyTrashed()->findOrFail($id);
|
||||
|
||||
if ($proclamatore->assegnazioni()->exists()) {
|
||||
|
||||
@@ -22,6 +22,8 @@ class ProclamatoreCreate extends Component
|
||||
|
||||
public function save()
|
||||
{
|
||||
$this->authorize('settings.manage');
|
||||
|
||||
$this->validate();
|
||||
|
||||
$proclamatore = Proclamatore::create([
|
||||
|
||||
@@ -31,6 +31,8 @@ class ProclamatoreEdit extends Component
|
||||
|
||||
public function save()
|
||||
{
|
||||
$this->authorize('settings.manage');
|
||||
|
||||
$this->validate();
|
||||
|
||||
$this->proclamatore->update([
|
||||
|
||||
@@ -42,12 +42,20 @@ class ProclamatoreIndex extends Component
|
||||
|
||||
public function toggleActive(int $id)
|
||||
{
|
||||
// La lista è in sola lettura per i non-admin: creare/modificare/
|
||||
// eliminare proclamatori è riservato all'amministratore. Il check sta
|
||||
// nel metodo perché la rotta index resta accessibile con
|
||||
// proclamatori.manage.
|
||||
$this->authorize('settings.manage');
|
||||
|
||||
$proclamatore = Proclamatore::findOrFail($id);
|
||||
$proclamatore->update(['attivo' => !$proclamatore->attivo]);
|
||||
}
|
||||
|
||||
public function deleteProclamatore(int $id)
|
||||
{
|
||||
$this->authorize('settings.manage');
|
||||
|
||||
$proclamatore = Proclamatore::findOrFail($id);
|
||||
|
||||
if ($proclamatore->assegnazioni()->aperte()->exists()) {
|
||||
@@ -61,6 +69,8 @@ class ProclamatoreIndex extends Component
|
||||
|
||||
public function anonimizza(int $id)
|
||||
{
|
||||
$this->authorize('settings.manage');
|
||||
|
||||
$proclamatore = Proclamatore::findOrFail($id);
|
||||
$proclamatore->anonimizza();
|
||||
session()->flash('success', "Dati personali del proclamatore anonimizzati (GDPR).");
|
||||
|
||||
Reference in New Issue
Block a user