mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:26:31 +08:00
Merge pull request #19 from flarum/ds/flags-api-logged-in-check
Assert registered in /api/flags to fix issue with guests
This commit is contained in:
commit
f46719c639
|
@ -14,11 +14,14 @@ namespace Flarum\Flags\Api\Controller;
|
|||
use Flarum\Api\Controller\AbstractListController;
|
||||
use Flarum\Flags\Api\Serializer\FlagSerializer;
|
||||
use Flarum\Flags\Flag;
|
||||
use Flarum\User\AssertPermissionTrait;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Tobscure\JsonApi\Document;
|
||||
|
||||
class ListFlagsController extends AbstractListController
|
||||
{
|
||||
use AssertPermissionTrait;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -41,6 +44,8 @@ class ListFlagsController extends AbstractListController
|
|||
{
|
||||
$actor = $request->getAttribute('actor');
|
||||
|
||||
$this->assertRegistered($actor);
|
||||
|
||||
$actor->read_flags_at = time();
|
||||
$actor->save();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user