Merge pull request #863 from jellykells/jellykells/owner_view_unapproved

Allow image owner to view their unapproved images
This commit is contained in:
Shish 2022-07-08 22:20:52 +01:00 committed by GitHub
commit 476808db4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -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;

View File

@ -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];