Merge pull request #863 from jellykells/jellykells/owner_view_unapproved
Allow image owner to view their unapproved images
This commit is contained in:
commit
476808db4b
2 changed files with 7 additions and 1 deletions
|
@ -193,7 +193,7 @@ class Approval extends Extension
|
|||
{
|
||||
global $user, $config;
|
||||
|
||||
if ($config->get_bool(ApprovalConfig::IMAGES) && $image->approved===false && !$user->can(Permissions::APPROVE_IMAGE)) {
|
||||
if ($config->get_bool(ApprovalConfig::IMAGES) && $image->approved===false && !$user->can(Permissions::APPROVE_IMAGE) && $user->id!==$image->owner_id) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -277,6 +277,12 @@ class CommentList extends Extension
|
|||
) {
|
||||
$image = null; // this is "clever", I may live to regret it
|
||||
}
|
||||
if (
|
||||
Extension::is_enabled(ApprovalInfo::KEY) && !is_null($image) &&
|
||||
$image->approved!==true
|
||||
) {
|
||||
$image = null;
|
||||
}
|
||||
if (!is_null($image)) {
|
||||
$comments = $this->get_comments($image->id);
|
||||
$images[] = [$image, $comments];
|
||||
|
|
Reference in a new issue