Scalr_Account_User::isTeamOwnerInEnvironment PHP Method

isTeamOwnerInEnvironment() public method

Checks if the user is both AccountAdmin and member of the specified environment
Deprecation: This function has been deprecated since new ACL
public isTeamOwnerInEnvironment ( integer $envId ) : boolean
$envId integer The identifier of the environment
return boolean
    public function isTeamOwnerInEnvironment($envId)
    {
        if (!$this->isAccountAdmin()) {
            return false;
        }
        $ret = $this->db->GetOne("\n            SELECT 1\n            FROM account_team_users tu\n            JOIN account_team_envs te ON te.team_id = tu.team_id\n            JOIN account_teams t ON t.id = tu.team_id\n            JOIN client_environments e ON e.id = te.env_id\n            WHERE tu.user_id = ? AND e.client_id = ?\n            AND t.account_id = ? AND te.env_id = ?\n            LIMIT 1\n        ", array($this->id, $this->accountId, $this->accountId, $envId));
        return (bool) $ret;
    }