public function getRule($ruleId, $modify = false)
{
$rule = AccountScript::findPk($ruleId);
if (!$rule) {
throw new ApiErrorException(404, ErrorMessage::ERR_OBJECT_NOT_FOUND, "Requested Rule either does not exist or is not owned by your account.");
}
if (!$this->hasPermissions($rule, $modify)) {
//Checks entity level write access permissions
throw new ApiErrorException(403, ErrorMessage::ERR_PERMISSION_VIOLATION, "Insufficient permissions");
}
return $rule;
}