public static function can_comment_user($planuserid) {
        global $USER;

        $capabilities = array('moodle/competency:plancomment');
        if ($USER->id == $planuserid) {
            $capabilities[] = 'moodle/competency:plancommentown';
        }

        return has_any_capability($capabilities, context_user::instance($planuserid));
    }
public static function can_comment_user($planuserid) {
        global $USER;

        $capabilities = array('moodle/competency:plancomment');
        if ($USER->id == $planuserid) {
            $capabilities[] = 'moodle/competency:plancommentown';
        }

        return has_any_capability($capabilities, context_user::instance($planuserid));
    }
public static function can_comment_user ( $ planuserid ) { global $ USER ; $ capabilities = array ( 'moodle/competency:plancomment' ) ; if ( $ USER -> id == $ planuserid ) { $ capabilities [ ] = 'moodle/competency:plancommentown' ; } return has_any_capability ( $ capabilities , context_user :: instance ( $ planuserid ) ) ; }
Can the current user comment on a user's plan?

@param int $planuserid The user ID the plan belongs to.
@return bool
Can the current user comment on a user s plan?