aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-28 04:41:12 -0700
committerfriendica <info@friendica.com>2013-09-28 04:41:12 -0700
commit110974eb55d58db26f1312d19ae4cdf09bbc796f (patch)
tree271663f4117bbef5cd26ab45cbad773aaaaa7698 /mod/item.php
parent8fe557546921661e83a4cf1b0ba31e8bd3b26880 (diff)
downloadvolse-hubzilla-110974eb55d58db26f1312d19ae4cdf09bbc796f.tar.gz
volse-hubzilla-110974eb55d58db26f1312d19ae4cdf09bbc796f.tar.bz2
volse-hubzilla-110974eb55d58db26f1312d19ae4cdf09bbc796f.zip
fix can_comment_on_post when viewing wall-to-wall
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/mod/item.php b/mod/item.php
index 813bcf283..f1fbd53b3 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -161,20 +161,26 @@ function item_post(&$a) {
if($parent) {
logger('mod_item: item_post parent=' . $parent);
- if(! can_comment_on_post($observer['xchan_hash'],$parent_item)) {
+ $can_comment = false;
+ if((array_key_exists('owner',$parent_item)) && ($parent_item['owner']['abook_flags'] & ABOOK_FLAG_SELF))
+ $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) {
notice( t('Permission denied.') . EOL) ;
if(x($_REQUEST,'return'))
goaway($a->get_baseurl() . "/" . $return_path );
killme();
}
}
-
-
- if(! perm_is_allowed($profile_uid,$observer['xchan_hash'],(($parent) ? 'post_comments' : 'post_wall'))) {
- notice( t('Permission denied.') . EOL) ;
- if(x($_REQUEST,'return'))
- goaway($a->get_baseurl() . "/" . $return_path );
- killme();
+ else {
+ if(! perm_is_allowed($profile_uid,$observer['xchan_hash'],'post_wall')) {
+ notice( t('Permission denied.') . EOL) ;
+ if(x($_REQUEST,'return'))
+ goaway($a->get_baseurl() . "/" . $return_path );
+ killme();
+ }
}