original_string: public function update(UserPolicy $user, Team $team)
      {
          if ($user->canDo('team.team.edit') && $user->isAdmin()) {
              return true;
          }
  
          return $team->user_id == user_id() && $team->user_type == user_type();
      }
code: public function update(UserPolicy $user, Team $team)
      {
          if ($user->canDo('team.team.edit') && $user->isAdmin()) {
              return true;
          }
  
          return $team->user_id == user_id() && $team->user_type == user_type();
      }
code_tokens: public function update ( UserPolicy $ user , Team $ team ) { if ( $ user -> canDo ( 'team.team.edit' ) && $ user -> isAdmin ( ) ) { return true ; } return $ team -> user_id == user_id ( ) && $ team -> user_type == user_type ( ) ; }
docstring: Determine if the given user can update the given team.
  
  @param UserPolicy $user
  @param Team $team
  
  @return bool
docstring_tokens: Determine if the given user can update the given team .