public static function can_manage_user($planuserid) {
        global $USER;
        $context = context_user::instance($planuserid);

        $capabilities = array('moodle/competency:planmanage');
        if ($context->instanceid == $USER->id) {
            $capabilities[] = 'moodle/competency:planmanageown';
        }

        return has_any_capability($capabilities, $context);
    }