code: def authorize(self, ip_protocol=None, from_port=None, to_port=None,
                    cidr_ip=None, src_group=None):
          
          if src_group:
              cidr_ip = None
              src_group_name = src_group.name
              src_group_owner_id = src_group.owner_id
          else:
              src_group_name = None
              src_group_owner_id = None
          status = self.connection.authorize_security_group(self.name,
                                                            src_group_name,
                                                            src_group_owner_id,
                                                            ip_protocol,
                                                            from_port,
                                                            to_port,
                                                            cidr_ip)
          if status:
              self.add_rule(ip_protocol, from_port, to_port, src_group_name,
                            src_group_owner_id, cidr_ip)
          return status
docs: Add a new rule to this security group.
          You need to pass in either src_group_name
          OR ip_protocol, from_port, to_port,
          and cidr_ip.  In other words, either you are authorizing another
          group or you are authorizing some ip-based rule.
          
          :type ip_protocol: string
          :param ip_protocol: Either tcp | udp | icmp
  
          :type from_port: int
          :param from_port: The beginning port number you are enabling
  
          :type to_port: int
          :param to_port: The ending port number you are enabling
  
          :type cidr_ip: string
          :param cidr_ip: The CIDR block you are providing access to.
                          See http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
  
          :type src_group: :class:`boto.ec2.securitygroup.SecurityGroup` or
                           :class:`boto.ec2.securitygroup.GroupOrCIDR`
          :param src_group: The Security Group you are granting access to.
                           
          :rtype: bool
          :return: True if successful.