Migration complete

This commit is contained in:
2026-06-23 19:24:38 +02:00
parent 279160c1cb
commit 64b26ef059
126 changed files with 8121 additions and 221 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Policies;
use App\Models\Entry;
use App\Models\EntryReview;
use App\Models\User;
class EntryReviewPolicy
{
public function viewAny(\App\Auth\XenForoUser $user): bool
{
if( $user->_can( 'romhackplaza', 'view' ) )
return true;
return false;
}
public function create(\App\Auth\XenForoUser $user, ?EntryReview $review = null ): bool
{
return $user->_can( 'romhackplaza', 'canSubmitEntry' );
}
public function update(\App\Auth\XenForoUser $user, ?EntryReview $review = null ): bool
{
// Staff editors
if( $user->_can('romhackplaza', 'canEditOthersEntries') )
return true;
// Author.
if( $user->_can( 'romhackplaza', 'canEditMyEntries' ) && $review->user_id === $user->user_id )
return true;
return false;
}
}