update: allow editors to bypass metadata rate limiter

This commit is contained in:
Roardom
2024-02-14 01:12:49 +00:00
parent 9fe4abd3b1
commit 78e3099e71
@@ -114,7 +114,12 @@ class SimilarTorrentController extends Controller
/** @var Carbon $lastUpdated */
$lastUpdated = cache()->get($cacheKey);
abort_if($lastUpdated !== null && $lastUpdated->addDay()->isFuture() && !$request->user()->group->is_modo, 403);
abort_if(
$lastUpdated !== null
&& $lastUpdated->addDay()->isFuture()
&& !($request->user()->group->is_modo || $request->user()->group->is_editor),
403
);
cache()->put($cacheKey, now(), now()->addDay());
@@ -127,7 +132,12 @@ class SimilarTorrentController extends Controller
/** @var Carbon $lastUpdated */
$lastUpdated = cache()->get($cacheKey);
abort_if($lastUpdated !== null && $lastUpdated->addDay()->isFuture() && !$request->user()->group->is_modo, 403);
abort_if(
$lastUpdated !== null
&& $lastUpdated->addDay()->isFuture()
&& !($request->user()->group->is_modo || $request->user()->group->is_editor),
403
);
cache()->put($cacheKey, now(), now()->addDay());