mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
implement mod delete functions
This commit is contained in:
parent
5cfffef2b4
commit
d2de62a7d3
@ -55,5 +55,10 @@ class ModController extends Controller
|
|||||||
return new ModResource($mod);
|
return new ModResource($mod);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function destroy(Mod $mod): void {}
|
public function destroy(Mod $mod): void
|
||||||
|
{
|
||||||
|
$this->authorize('delete', $mod);
|
||||||
|
|
||||||
|
$mod->delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,10 @@ class ModPolicy
|
|||||||
*/
|
*/
|
||||||
public function delete(User $user, Mod $mod): bool
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user