envVarNameForPushUser() public method

public envVarNameForPushUser ( ) : PhpOption\Option
return PhpOption\Option [string] Name of environment variable capturing name of user performing `git push`
Beispiel #1
0
 /**
  * @return boolean If the user doing the push is a super user
  */
 private function isSuperUser()
 {
     $optVarName = $this->config->envVarNameForPushUser();
     return $optVarName->map(function ($varName) {
         $superUsers = $this->config->superUserNames();
         $this->logger->trace(count($superUsers) . " superuser(s) configured");
         $currentUser = getenv($varName);
         $this->logger->trace("Current {$varName} is {$currentUser}");
         return in_array($currentUser, $superUsers);
     })->getOrElse(false);
 }