Adds a Delete button to the ViewPhotoPage.

The Delete button is non functional yet and is only available for
admins and the photo owner.
This commit is contained in:
2018-07-02 18:32:59 +00:00
parent fcbbc7106d
commit 344db6e4c5
3 changed files with 33 additions and 0 deletions

View File

@@ -43,6 +43,11 @@ class ViewPhoto extends HTMLController
if ($next_url)
$page->setNextPhotoUrl($next_url);
$user = Registry::get('user');
$author = $photo->getAuthor();
if ($user->isAdmin() || $user->getUserId() === $author->getUserId())
$page->setIsAssetOwner(true);
$this->page->adopt($page);
$this->page->setCanonicalUrl($photo->getPageUrl());