Revert "Fix: Authors unable to comment on posts they authored when under owned by others in certain circumstances."
This reverts commit e2824f9259.
Reverting because it breaks forum mentions.
This commit is contained in:
@@ -237,12 +237,10 @@ class Item extends \Zotlabs\Web\Controller {
|
|||||||
if($parent) {
|
if($parent) {
|
||||||
logger('mod_item: item_post parent=' . $parent);
|
logger('mod_item: item_post parent=' . $parent);
|
||||||
$can_comment = false;
|
$can_comment = false;
|
||||||
|
if((array_key_exists('owner',$parent_item)) && intval($parent_item['owner']['abook_self']))
|
||||||
$can_comment = can_comment_on_post($observer['xchan_hash'],$parent_item);
|
|
||||||
if (!$can_comment) {
|
|
||||||
if((array_key_exists('owner',$parent_item)) && intval($parent_item['owner']['abook_self'])==1 )
|
|
||||||
$can_comment = perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_comments');
|
$can_comment = perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_comments');
|
||||||
}
|
else
|
||||||
|
$can_comment = can_comment_on_post($observer['xchan_hash'],$parent_item);
|
||||||
|
|
||||||
if(! $can_comment) {
|
if(! $can_comment) {
|
||||||
notice( t('Permission denied.') . EOL) ;
|
notice( t('Permission denied.') . EOL) ;
|
||||||
|
|||||||
@@ -1809,20 +1809,7 @@ function process_delivery($sender, $arr, $deliveries, $relay, $public = false, $
|
|||||||
$arr['item_wall'] = 0;
|
$arr['item_wall'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$allowed = (perm_is_allowed($channel['channel_id'],$sender['hash'],$perm) && (! $tag_delivery) && (! $local_public));
|
if((! perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)) && (! $tag_delivery) && (! $local_public)) {
|
||||||
|
|
||||||
if(! $allowed && $perm == 'post_comments') {
|
|
||||||
logger("Channel = ".intval($channel['channel_id']));
|
|
||||||
$parent = q("select * from item where mid = '%s' and uid = %d limit 1",
|
|
||||||
dbesc($arr['parent_mid']),
|
|
||||||
intval($channel['channel_id'])
|
|
||||||
);
|
|
||||||
if ($parent) {
|
|
||||||
$allowed = can_comment_on_post($d['hash'],$parent[0]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $allowed) {
|
|
||||||
logger("permission denied for delivery to channel {$channel['channel_id']} {$channel['channel_address']}");
|
logger("permission denied for delivery to channel {$channel['channel_id']} {$channel['channel_address']}");
|
||||||
$DR->update('permission denied');
|
$DR->update('permission denied');
|
||||||
$result[] = $DR->get();
|
$result[] = $DR->get();
|
||||||
|
|||||||
Reference in New Issue
Block a user