Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-10903

Adding usergroup permissions adds wrong hostgroup

XMLWordPrintable

      When adding permissions to usergroups in the administrator interface (as superuser).

      • Under composing permissions I click 'add' in the readonly permissions.
      • I get a popup with all hostgroups.
      • I select one hostgroup (in screenshot: Web2all) and click select.
      • The host group with name 'Web2All' gets added to the readonly list
      • In 'Calculated permissions' in the hostgroups box the 'Local node: Glasvezel' gets put in automatically (see screenshot).
      • after saving, the readonly right for 'Glasvelzel' gets saved instead of 'Web2All'.

      When debugging the page, the added 'Web2All' hostgroup has the id of the 'Glasvezel' group.
      More dubugging reveals the wrong id is assigned by the addGroups() javascript function in popup_right.php.
      Happens both with firefox and IE.

      Narrowing down the problem to the usage of the jQuery data() method. Something is broken there. When using the jQuery attr() method, everything works as expected.

      diff popup_right.php popup_right.php.fix
      136c136
      <                               var id = obj.data('id');
      ---
      >                               var id = obj.attr('data-id');
      138c138
      <                               add_variable('input', 'new_right[' + id + '][permission]', obj.data('permission'), formName,
      ---
      >                               add_variable('input', 'new_right[' + id + '][permission]', obj.attr('data-permission'), formName,
      140c140
      <                               add_variable('input', 'new_right[' + id + '][name]', obj.data('name'), formName, parentDocument);
      ---
      >                               add_variable('input', 'new_right[' + id + '][name]', obj.attr('data-name'), formName, parentDocument);
      

      Issue is at least present since zabbix 2.2.5

        1. zabbix_permissions_issue_1.JPG
          94 kB
          Merijn van den Kroonenberg
        2. zabbix-issue-installations.txt
          2 kB
          Merijn van den Kroonenberg

            Unassigned Unassigned
            merijnvdk Merijn van den Kroonenberg
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: