code: public function serverGroupPermAutoAssign($sgtype, $permid, $permvalue, $permnegated = false, $permskip = false)
      {
          if (!is_array($permid)) {
              $permident = (is_numeric($permid)) ? "permid" : "permsid";
          } else {
              $permident = (is_numeric(current($permid))) ? "permid" : "permsid";
          }
  
          $this->execute(
              "servergroupautoaddperm",
              array(
                  "sgtype" => $sgtype,
                  $permident => $permid,
                  "permvalue" => $permvalue,
                  "permnegated" => $permnegated,
                  "permskip" => $permskip
              )
          );
      }
docs: Adds a set of specified permissions to all regular server groups on all virtual servers. The target groups will
  be identified by the value of their i_group_auto_update_type permission specified with $sgtype.
  
  @param  integer $sgtype
  @param  integer $permid
  @param  integer $permvalue
  @param bool|int $permnegated
  @param bool|int $permskip
  @return void