Check permissions for time travel and element undo.

This commit is contained in:
Jan Böhmer 2020-03-07 20:49:52 +01:00
parent 254d4e6c69
commit 8a61b465d0
23 changed files with 370 additions and 90 deletions

View file

@ -86,13 +86,21 @@ class HomepageController extends AbstractController
*/
public function homepage(Request $request, GitVersionInfo $versionInfo): Response
{
$table = $this->dataTable->createFromType(LogDataTable::class, [
'mode' => 'last_activity'
], ['pageLength' => 10])
->handleRequest($request);
if ($this->isGranted("@tools.lastActivity")) {
$table = $this->dataTable->createFromType(
LogDataTable::class,
[
'mode' => 'last_activity'
],
['pageLength' => 10]
)
->handleRequest($request);
if ($table->isCallback()) {
return $table->getResponse();
if ($table->isCallback()) {
return $table->getResponse();
}
} else {
$table = null;
}
return $this->render('homepage.html.twig', [