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:
committed by
GitHub
parent
da598db376
commit
94d69fe15f
@@ -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;
|
||||
|
Reference in New Issue
Block a user