public function checkPermission(\Scalr_Account_User $user, $envId)
{
if ($this->accountId && $this->accountId != $user->getAccountId()) {
throw new \Scalr_Exception_InsufficientPermissions();
}
if ($this->envId && $this->envId != $envId) {
throw new \Scalr_Exception_InsufficientPermissions();
}
}