This commit is contained in:
lalka2016 2023-08-13 19:17:34 +03:00
parent adef21d3a9
commit f58518300c
3 changed files with 3 additions and 3 deletions

View file

@ -887,7 +887,7 @@ final class Wall extends VKAPIRequestHandler
$wallOwner = $post->getWallOwner();
if($post->getTargetWall() < 0 && !$post->getWallOwner()->canBeModifiedBy($this->getUser()) && $post->getWallOwner()->getWallType() != 1)
if($post->getTargetWall() < 0 && !$post->getWallOwner()->canBeModifiedBy($this->getUser()) && $post->getWallOwner()->getWallType() != 1 && $post->getSuggestionType() == 0)
$this->fail(12, "Access denied: you can't delete your accepted post.");
if($post->getOwnerPost() == $this->getUser()->getId() || $post->getTargetWall() == $this->getUser()->getId() || $owner_id < 0 && $wallOwner->canBeModifiedBy($this->getUser())) {

View file

@ -207,7 +207,7 @@ class Post extends Postable
function canBeDeletedBy(User $user): bool
{
if($this->getTargetWall() < 0 && !$this->getWallOwner()->canBeModifiedBy($user) && $this->getWallOwner()->getWallType() != 1)
if($this->getTargetWall() < 0 && !$this->getWallOwner()->canBeModifiedBy($user) && $this->getWallOwner()->getWallType() != 1 && $this->getSuggestionType() == 0)
return false;
return $this->getOwnerPost() === $user->getId() || $this->canBePinnedBy($user);

View file

@ -492,7 +492,7 @@ final class WallPresenter extends OpenVKPresenter
else $canBeDeletedByOtherUser = false;
if(!is_null($user)) {
if($post->getTargetWall() < 0 && !$post->getWallOwner()->canBeModifiedBy($this->user->identity) && $post->getWallOwner()->getWallType() != 1)
if($post->getTargetWall() < 0 && !$post->getWallOwner()->canBeModifiedBy($this->user->identity) && $post->getWallOwner()->getWallType() != 1 && $post->getSuggestionType() == 0)
$this->flashFail("err", tr("failed_to_delete_post"), tr("error_deleting_suggested"));
if($post->getOwnerPost() == $user || $post->getTargetWall() == $user || $canBeDeletedByOtherUser) {