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

        $capabilities = array('moodle/competency:usercompetencycomment');
        if ($USER->id == $userid) {
            $capabilities[] = 'moodle/competency:usercompetencycommentown';
        }

        if (has_any_capability($capabilities, context_user::instance($userid))) {
            return true;
        }

        return false;
    }
public static function can_comment_user($userid) {
        global $USER;

        $capabilities = array('moodle/competency:usercompetencycomment');
        if ($USER->id == $userid) {
            $capabilities[] = 'moodle/competency:usercompetencycommentown';
        }

        if (has_any_capability($capabilities, context_user::instance($userid))) {
            return true;
        }

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

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