mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-22 07:12:36 +00:00
3946158e88
Not yested covered with testing. Changes database columns for more presentable names and for future use to connect additional model types. For #4316
29 lines
862 B
PHP
29 lines
862 B
PHP
<?php
|
|
|
|
namespace BookStack\Activity\Controllers;
|
|
|
|
use BookStack\Activity\Models\Activity;
|
|
use BookStack\Http\ApiController;
|
|
|
|
class AuditLogApiController extends ApiController
|
|
{
|
|
/**
|
|
* Get a listing of audit log events in the system.
|
|
* The loggable relation fields currently only relates to core
|
|
* content types (page, book, bookshelf, chapter) but this may be
|
|
* used more in the future across other types.
|
|
* Requires permission to manage both users and system settings.
|
|
*/
|
|
public function list()
|
|
{
|
|
$this->checkPermission('settings-manage');
|
|
$this->checkPermission('users-manage');
|
|
|
|
$query = Activity::query()->with(['user']);
|
|
|
|
return $this->apiListingResponse($query, [
|
|
'id', 'type', 'detail', 'user_id', 'loggable_id', 'loggable_type', 'ip', 'created_at',
|
|
]);
|
|
}
|
|
}
|