mirror of
https://github.com/openvk/openvk
synced 2025-07-07 00:09:48 +03:00
b
This commit is contained in:
parent
fcf281bf58
commit
2144189832
1 changed files with 7 additions and 4 deletions
|
@ -186,8 +186,8 @@ final class Notes extends VKAPIRequestHandler
|
||||||
if(!$user || $user->isDeleted())
|
if(!$user || $user->isDeleted())
|
||||||
$this->fail(15, "Invalid user");
|
$this->fail(15, "Invalid user");
|
||||||
|
|
||||||
if(!$user->getOwner()->getPrivacyPermission('notes.read', $this->getUser()))
|
if(!$user->getPrivacyPermission('notes.read', $this->getUser()))
|
||||||
$this->fail(43, "No access");
|
$this->fail(43, "Access denied: this user chose to hide his notes");
|
||||||
|
|
||||||
if(empty($note_ids)) {
|
if(empty($note_ids)) {
|
||||||
$notes = array_slice(iterator_to_array((new NotesRepo)->getUserNotes($user, 1, $count + $offset, $sort == 0 ? "ASC" : "DESC")), $offset);
|
$notes = array_slice(iterator_to_array((new NotesRepo)->getUserNotes($user, 1, $count + $offset, $sort == 0 ? "ASC" : "DESC")), $offset);
|
||||||
|
@ -231,10 +231,13 @@ final class Notes extends VKAPIRequestHandler
|
||||||
|
|
||||||
if($note->isDeleted())
|
if($note->isDeleted())
|
||||||
$this->fail(189, "Note is deleted");
|
$this->fail(189, "Note is deleted");
|
||||||
|
|
||||||
if(!$note->getOwner() || $note->getOwner()->isDeleted() || !$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser()))
|
if(!$note->getOwner() || $note->getOwner()->isDeleted())
|
||||||
$this->fail(177, "Owner does not exists");
|
$this->fail(177, "Owner does not exists");
|
||||||
|
|
||||||
|
if(!$note->getOwner()->getPrivacyPermission('notes.read', $this->getUser()))
|
||||||
|
$this->fail(40, "Access denied: this user chose to hide his notes");
|
||||||
|
|
||||||
return $note->toVkApiStruct();
|
return $note->toVkApiStruct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue