From 070ea16536c74316ef5ebb65b1d01274ad9c97f2 Mon Sep 17 00:00:00 2001 From: celestora Date: Thu, 6 Jul 2023 11:44:46 +0300 Subject: [PATCH] Fix permissions reporting (can_create_topic, can_post) for clubs in vk api --- Web/Models/Entities/Club.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Web/Models/Entities/Club.php b/Web/Models/Entities/Club.php index b321a476..15c458a9 100644 --- a/Web/Models/Entities/Club.php +++ b/Web/Models/Entities/Club.php @@ -382,9 +382,9 @@ class Club extends RowModel $res->photo_100 = $this->getAvatarUrl("tiny"); $res->photo_200 = $this->getAvatarUrl("normal"); - $res->can_create_topic = $this->canBeModifiedBy($user) ? 1 : $this->isEveryoneCanCreateTopics() ? 1 : 0; + $res->can_create_topic = $this->canBeModifiedBy($user) ? 1 : ($this->isEveryoneCanCreateTopics() ? 1 : 0); - $res->can_post = $this->canBeModifiedBy($user) ? 1 : $this->canPost() ? 1 : 0; + $res->can_post = $this->canBeModifiedBy($user) ? 1 : ($this->canPost() ? 1 : 0); return (object) $res; }