original_string: 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);
      }
code: 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);
      }
code_tokens: 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 ) ; }
docstring: Can the current user manage a user's plan?
  
  @param  int $planuserid The user to whom the plan would belong.
  @return bool
docstring_tokens: Can the current user manage a user s plan?