Version 5.0.13

This commit is contained in:
Neo committed 2025-12-19 19:04:57 -08:00
1 parent b89858b2ff
commit 5efe744c5f
1407 files changed
+69690 -30177

No files matched your search

+20 -4
View File
@@ -231,10 +231,19 @@ class ItemController extends Controller
$class = $this->class;
$item = $class::load( $id );
if ( $this->member and !$item->can( 'read', $this->member ) )
if( $this->member )
{
throw new OutOfRangeException;
if ( method_exists($item, 'canView') and !$item->canView( $this->member ) )
{
throw new OutOfRangeException;
}
else if ( !$item->can( 'read', $this->member ) )
{
throw new OutOfRangeException;
}
}
return new Response( 200, $item->apiOutput( $this->member ) );
}
@@ -571,9 +580,16 @@ class ItemController extends Controller
* @var Comment $commentClass */
$itemClass = $this->class;
$item = $itemClass::load( $id );
if ( $this->member and !$item->can( 'read', $this->member ) )
if( $this->member )
{
throw new OutOfRangeException;
if ( method_exists($item, 'canView') and !$item->canView( $this->member ) )
{
throw new OutOfRangeException;
}
else if ( !$item->can( 'read', $this->member ) )
{
throw new OutOfRangeException;
}
}
$itemIdColumn = $itemClass::$databaseColumnId;
$where [] = array( $commentClass::$databasePrefix . $commentClass::$databaseColumnMap['item'] . '=?', $item->$itemIdColumn );