VKAPI: Make groups.getById not require auth

Just like the original VK
This commit is contained in:
Maxim Leshchenko 2022-07-21 17:57:03 +01:00
parent 2d09e0116e
commit 8ce8355784
No known key found for this signature in database
GPG key ID: BB9C44A8733FBEEE

View file

@ -110,8 +110,6 @@ final class Groups extends VKAPIRequestHandler
function getById(string $group_ids = "", string $group_id = "", string $fields = ""): ?array function getById(string $group_ids = "", string $group_id = "", string $fields = ""): ?array
{ {
$this->requireUser();
$clubs = new ClubsRepo; $clubs = new ClubsRepo;
if ($group_ids == NULL && $group_id != NULL) if ($group_ids == NULL && $group_id != NULL)
@ -191,10 +189,11 @@ final class Groups extends VKAPIRequestHandler
$response[$i]->contacts = $contacts; $response[$i]->contacts = $contacts;
break; break;
case 'can_post': case 'can_post':
if($clb->canBeModifiedBy($this->getUser())) if(!is_null($this->getUser()))
$response[$i]->can_post = true; if($clb->canBeModifiedBy($this->getUser()))
else $response[$i]->can_post = true;
$response[$i]->can_post = $clb->canPost(); else
$response[$i]->can_post = $clb->canPost();
break; break;
} }
} }