Implement creator studio and upload updates
This commit is contained in:
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Support\Moderation;
|
||||
|
||||
use App\Models\Artwork;
|
||||
use App\Models\ArtworkComment;
|
||||
use App\Models\Collection;
|
||||
use App\Models\CollectionComment;
|
||||
use App\Models\CollectionSubmission;
|
||||
@@ -15,6 +17,7 @@ use App\Models\NovaCardChallengeEntry;
|
||||
use App\Models\NovaCardComment;
|
||||
use App\Models\Report;
|
||||
use App\Models\Story;
|
||||
use App\Models\StoryComment;
|
||||
use App\Models\User;
|
||||
use App\Services\NovaCards\NovaCardPublishModerationService;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
@@ -36,6 +39,8 @@ class ReportTargetResolver
|
||||
'conversation',
|
||||
'user',
|
||||
'story',
|
||||
'story_comment',
|
||||
'artwork_comment',
|
||||
'collection',
|
||||
'collection_comment',
|
||||
'collection_submission',
|
||||
@@ -86,6 +91,22 @@ class ReportTargetResolver
|
||||
Story::query()->findOrFail($targetId);
|
||||
return;
|
||||
|
||||
case 'story_comment':
|
||||
$storyComment = StoryComment::query()->with('story')->findOrFail($targetId);
|
||||
abort_unless(
|
||||
$storyComment->story !== null
|
||||
&& Story::query()->published()->whereKey($storyComment->story_id)->exists(),
|
||||
403,
|
||||
'You are not allowed to report this comment.'
|
||||
);
|
||||
return;
|
||||
|
||||
case 'artwork_comment':
|
||||
$artworkComment = ArtworkComment::query()->with('artwork')->findOrFail($targetId);
|
||||
$artwork = $artworkComment->artwork;
|
||||
abort_unless($artwork instanceof Artwork && (bool) $artwork->is_public && $artwork->published_at !== null, 403, 'You are not allowed to report this comment.');
|
||||
return;
|
||||
|
||||
case 'collection':
|
||||
$collection = Collection::query()->findOrFail($targetId);
|
||||
abort_unless($collection->canBeViewedBy($user), 403, 'You are not allowed to report this collection.');
|
||||
|
||||
Reference in New Issue
Block a user