Skip to content

Commit d451795

Browse files
author
fuze
committed
1 parent 0e59507 commit d451795

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

package/system/controllers/api/api_actions/api_content_get.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public function run($ctype_name){
282282
if($items){
283283
foreach ($items as $key => $item) {
284284

285-
$is_private = $item['is_private'] && !$item['user']['is_friend'];
285+
$is_private = $item['is_private'] == 1 && !$item['user']['is_friend'];
286286

287287
$item['ctype'] = $this->ctype;
288288

package/system/controllers/api/api_actions/api_content_get_item.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,12 @@ public function validateApiRequest($ctype_name=null) {
106106
}
107107

108108
// Проверяем ограничения доступа из других контроллеров
109-
if ($this->item['is_parent_hidden']){
109+
if ($this->item['is_parent_hidden'] || $this->item['is_private']){
110110
$is_parent_viewable_result = cmsEventsManager::hook('content_view_hidden', array(
111111
'viewable' => true,
112112
'item' => $this->item,
113-
'is_moderator' => $is_moderator
113+
'is_moderator' => $is_moderator,
114+
'ctype' => $this->ctype
114115
));
115116
if (!$is_parent_viewable_result['viewable']){
116117
return array(

0 commit comments

Comments
 (0)