1
0
mirror of https://github.com/flarum/core.git synced 2025-10-11 23:14:29 +02:00

Introduce RequestUtil to encapsulate getting/setting actor on requests(#2449)

This commit is contained in:
Alexander Skvortsov
2021-04-07 23:33:05 -04:00
committed by GitHub
parent da598db376
commit 94d69fe15f
54 changed files with 134 additions and 56 deletions

View File

@@ -11,6 +11,7 @@ namespace Flarum\Post;
use DateTime;
use Flarum\Foundation\AbstractServiceProvider;
use Flarum\Http\RequestUtil;
use Flarum\Post\Access\ScopePostVisibility;
class PostServiceProvider extends AbstractServiceProvider
@@ -26,7 +27,7 @@ class PostServiceProvider extends AbstractServiceProvider
return;
}
$actor = $request->getAttribute('actor');
$actor = RequestUtil::getActor($request);
if ($actor->can('postWithoutThrottle')) {
return false;