mirror of
https://github.com/flarum/core.git
synced 2025-08-05 16:07:34 +02:00
fix: approving content
This commit is contained in:
@@ -19,7 +19,9 @@ class PostResourceFields
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
Schema\Boolean::make('isApproved')
|
Schema\Boolean::make('isApproved')
|
||||||
->writable(fn (Post $post, Context $context) => $context->getActor()->can('approve', $post)),
|
->writable(fn (Post $post, Context $context) => $context->getActor()->can('approve', $post))
|
||||||
|
// set by the ApproveContent listener.
|
||||||
|
->set(fn () => null),
|
||||||
Schema\Boolean::make('canApprove')
|
Schema\Boolean::make('canApprove')
|
||||||
->get(fn (Post $post, Context $context) => $context->getActor()->can('approvePosts', $post->discussion)),
|
->get(fn (Post $post, Context $context) => $context->getActor()->can('approvePosts', $post->discussion)),
|
||||||
];
|
];
|
||||||
|
Reference in New Issue
Block a user