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);
    }
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);
    }
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 ) ; }
Can the current user manage a user's plan?

@param  int $planuserid The user to whom the plan would belong.
@return bool
Can the current user manage a user s plan?