Scalr\Api\Service\Account\V1beta0\Controller\Environments::denyTeamAction PHP Method

denyTeamAction() public method

Revoke team access to specified environment
public denyTeamAction ( integer $envId, integer $teamId ) : Scalr\Api\DataType\ResultEnvelope
$envId integer Environment ID
$teamId integer Team ID
return Scalr\Api\DataType\ResultEnvelope
    public function denyTeamAction($envId, $teamId)
    {
        if (!$this->getUser()->canManageAcl()) {
            throw new ApiInsufficientPermissionsException();
        }
        $this->getEnv($envId);
        $team = Account\TeamEnvs::findOne([['envId' => $envId], ['teamId' => $teamId]]);
        if (empty($team)) {
            throw new ApiErrorException(404, ErrorMessage::ERR_OBJECT_NOT_FOUND, "Team '{$teamId}' has no access to environment '{$envId}'");
        }
        $team->delete();
        return $this->result(null);
    }