Uploaded image for project: 'ZABBIX FEATURE REQUESTS'
  1. ZABBIX FEATURE REQUESTS
  2. ZBXNEXT-1531

Support "is_writable" API object attribute - calculates if row is accessible for write or not.

XMLWordPrintable

    • Icon: New Feature Request New Feature Request
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 2.1.0
    • API (A)
    • None

      Implementation example:

      CZBXAPI.php:

      
      

      /**

      • Add writable status field to result.
        *
      • @param array $result
      • @param array $options
        */
        protected function addWritableInfo($result, $options) {
        if (empty($options['is_writable'])) { return $result; }

      $pk = $this->pk($this->tableName);

      $objs = $this->get(array(
      $pk.'s' => zbx_objectValues($result, $pk),
      'editable' => true
      ));
      $objs = zbx_toHash($objs, $pk);

      foreach ($result as $id => $value)

      { $result[$id]['is_writable'] = isset($objs[$id]); }

      return $result;
      }

      
      

      Example usage:
      CTrigger->get()

      
      

      $result = $this->addWritableInfo($result, $options);

      
      

            eduards Eduards Samersovs (Inactive)
            eduards Eduards Samersovs (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: