implement mod delete functions

This commit is contained in:
IsWaffle 2024-10-08 09:24:44 -04:00
parent 5cfffef2b4
commit d2de62a7d3
2 changed files with 10 additions and 2 deletions

View File

@ -55,5 +55,10 @@ class ModController extends Controller
return new ModResource($mod);
}
public function destroy(Mod $mod): void {}
public function destroy(Mod $mod): void
{
$this->authorize('delete', $mod);
$mod->delete();
}
}

View File

@ -45,7 +45,10 @@ class ModPolicy
*/
public function delete(User $user, Mod $mod): bool
{
return false;
// I'm guessing we want the mod author to also be able to do this?
// what if there are multiple authors?
// I'm leaving that out for now -waffle.lazy
return $user->isMod() || $user->isAdmin();
}
/**