src/Model/Environment.php
public function addUser($user, $role, $byUuid = true)
    {
        $property = $byUuid ? 'user' : 'email';
        $body = [$property => $user, 'role' => $role];

        return EnvironmentAccess::create($body, $this->getLink('#manage-access'), $this->client);
    }
public function addUser($user, $role, $byUuid = true)
    {
        $property = $byUuid ? 'user' : 'email';
        $body = [$property => $user, 'role' => $role];

        return EnvironmentAccess::create($body, $this->getLink('#manage-access'), $this->client);
    }
public function addUser ( $ user , $ role , $ byUuid = true ) { $ property = $ byUuid ? 'user' : 'email' ; $ body = [ $ property => $ user , 'role' => $ role ] ; return EnvironmentAccess :: create ( $ body , $ this -> getLink ( '#manage-access' ) , $ this -> client ) ; }
Add a new user to the environment.

@param string $user   The user's UUID or email address (see $byUuid).
@param string $role   One of EnvironmentAccess::$roles.
@param bool   $byUuid Set true (default) if $user is a UUID, or false if
$user is an email address.

Note that for legacy reasons, the default for $byUuid is false for
Project::addUser(), but true for Environment::addUser().

@return Result
Add a new user to the environment .