forked from Public/pics
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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user