Skip to content

Commit b48a5b3

Browse files
authored
[Bugfix] Delete any on results policy (alexjustesen#548)
1 parent 7d3e0e9 commit b48a5b3

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

app/Policies/ResultPolicy.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function create(User $user)
4747
*/
4848
public function update(User $user, Result $result)
4949
{
50-
//
50+
return true;
5151
}
5252

5353
/**
@@ -60,6 +60,16 @@ public function delete(User $user, Result $result)
6060
return true;
6161
}
6262

63+
/**
64+
* Determine whether the user can delete multiple models.
65+
*
66+
* @return \Illuminate\Auth\Access\Response|bool
67+
*/
68+
public function deleteAny(User $user)
69+
{
70+
return true;
71+
}
72+
6373
/**
6474
* Determine whether the user can restore the model.
6575
*

app/Providers/AuthServiceProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44

55
// use Illuminate\Support\Facades\Gate;
66

7+
// TODO: remove package and policy as FailedJob is no longer included
78
use Amvisor\FilamentFailedJobs\Models\FailedJob;
9+
use App\Models\Result;
810
use App\Policies\FailedJobPolicy;
11+
use App\Policies\ResultPolicy;
912
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
1013

1114
class AuthServiceProvider extends ServiceProvider
@@ -17,6 +20,7 @@ class AuthServiceProvider extends ServiceProvider
1720
*/
1821
protected $policies = [
1922
FailedJob::class => FailedJobPolicy::class,
23+
Result::class => ResultPolicy::class,
2024
];
2125

2226
/**

0 commit comments

Comments
 (0)