mirror of
https://github.com/openvk/openvk
synced 2025-03-14 13:35:33 +03:00
oi blin
This commit is contained in:
parent
adef21d3a9
commit
f58518300c
3 changed files with 3 additions and 3 deletions
|
@ -887,7 +887,7 @@ final class Wall extends VKAPIRequestHandler
|
||||||
|
|
||||||
$wallOwner = $post->getWallOwner();
|
$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.");
|
$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())) {
|
if($post->getOwnerPost() == $this->getUser()->getId() || $post->getTargetWall() == $this->getUser()->getId() || $owner_id < 0 && $wallOwner->canBeModifiedBy($this->getUser())) {
|
||||||
|
|
|
@ -207,7 +207,7 @@ class Post extends Postable
|
||||||
|
|
||||||
function canBeDeletedBy(User $user): bool
|
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 false;
|
||||||
|
|
||||||
return $this->getOwnerPost() === $user->getId() || $this->canBePinnedBy($user);
|
return $this->getOwnerPost() === $user->getId() || $this->canBePinnedBy($user);
|
||||||
|
|
|
@ -492,7 +492,7 @@ final class WallPresenter extends OpenVKPresenter
|
||||||
else $canBeDeletedByOtherUser = false;
|
else $canBeDeletedByOtherUser = false;
|
||||||
|
|
||||||
if(!is_null($user)) {
|
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"));
|
$this->flashFail("err", tr("failed_to_delete_post"), tr("error_deleting_suggested"));
|
||||||
|
|
||||||
if($post->getOwnerPost() == $user || $post->getTargetWall() == $user || $canBeDeletedByOtherUser) {
|
if($post->getOwnerPost() == $user || $post->getTargetWall() == $user || $canBeDeletedByOtherUser) {
|
||||||
|
|
Loading…
Reference in a new issue