more work on #453
This commit is contained in:
parent
2c1b432613
commit
7d897a3f03
@ -266,21 +266,20 @@ class Like extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
xchan_query($r,true,(($r[0]['uid'] == local_channel()) ? 0 : local_channel()));
|
||||||
|
|
||||||
$item = $r[0];
|
$item = $r[0];
|
||||||
$owner_uid = $item['uid'];
|
|
||||||
$owner_aid = $item['aid'];
|
|
||||||
|
|
||||||
|
$owner_uid = $r[0]['uid'];
|
||||||
|
$owner_aid = $r[0]['aid'];
|
||||||
|
|
||||||
$sys = get_sys_channel();
|
$can_comment = false;
|
||||||
|
if((array_key_exists('owner',$item)) && intval($item['owner']['abook_self']))
|
||||||
|
$can_comment = perm_is_allowed($item['uid'],$observer['xchan_hash'],'post_comments');
|
||||||
|
else
|
||||||
|
$can_comment = can_comment_on_post($observer['xchan_hash'],$item);
|
||||||
|
|
||||||
|
if(! $can_comment) {
|
||||||
// if this is a "discover" item, (item['uid'] is the sys channel),
|
|
||||||
// fallback to the item comment policy, which should've been
|
|
||||||
// respected when generating the conversation thread.
|
|
||||||
// Even if the activity is rejected by the item owner, it should still get attached
|
|
||||||
// to the local discover conversation on this site.
|
|
||||||
|
|
||||||
if(($owner_uid != $sys['channel_id']) && (! perm_is_allowed($owner_uid,$observer['xchan_hash'],'post_comments'))) {
|
|
||||||
notice( t('Permission denied') . EOL);
|
notice( t('Permission denied') . EOL);
|
||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user