code: static function getPermission($code)
      {
          switch ($code) {
              case 1:
                  return self::$NONE;
              case "none":
                  return self::$NONE;
              case 2:
                  return self::$SOI;
              case "soi":
                  return self::$SOI;
              case 3:
                  return self::$COI;
              case "coi":
                  return self::$COI;
              case 4:
                  return self::$DOI;
              case "doi":
                  return self::$DOI;
              case 5:
                  return self::$DOI_PLUS;
              case "doi+":
                  return self::$DOI_PLUS;
              case 6:
                  return self::$OTHER;
              case "other":
                  return self::$OTHER;
  
              default:
                  return self::$OTHER;
          }
      }
docs: Get the permission object from the code
  
  @param var $code
  The code or type to get the permission object for.
  @return \em com_maileon_api_contacts_Permission
  The permission object for the given code.