[ZBX-9926] Host screens are not updated for user and admin user role Created: 2015 Oct 01  Updated: 2017 May 30  Resolved: 2016 Nov 14

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 2.4.6
Fix Version/s: 3.0.6rc1, 3.2.2rc1, 3.4.0alpha1

Type: Incident report Priority: Major
Reporter: Andrei Gushchin (Inactive) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: permissions, templatedscreens
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File graph prototype.png     PNG File simple graph prototype.png     PNG File super-admin screen.png     PNG File user screen.png    
Issue Links:
Duplicate

 Description   

Host screens generated partly for user with user types (Zabbix admin or Zabbix user) if its template included in some hostgroup with is denied for this user.



 Comments   
Comment by Andrei Gushchin (Inactive) [ 2015 Oct 05 ]

Steps to reproduce:

  • have some template(for example default OS Linux) which in some hostgroup1 and Templates host group.
  • have user1 as Zabbix user as user type in usergroup1 where hostgroup1 is denied for this usergroup
  • have user2 as Zabbix admin as user type in usergroup2 where hostgroup1 is denied for this usergroup
  • go to some host screen (for example from search results) under user1 or user2.

Finally we see difference between template screen and screen shown for user.
There are not shown simple graph prototype and graph prototype.
Examples attached.

Comment by Didier BONNEFOI [ 2016 Jun 27 ]

Hi,

I've got a the same behavior :

1/ when accessing Zabbix frontend with a user of type Zabbix admin or Zabbix user, with a readonly access to hostgroups != "Templates" :

  • host screens attached to templates with prototyped graph only show and repeat the first configured LLD graph instead of all defined LLD graph.
  • When I switch to other host's screens with prototyped graph, it's display the first selected screen's prototyped graph, not those of selected screen !
  • host's screens with no LLD graph are displayed correctly
  • I can correctly display LLD graphs under the Monitoring/Graphs sections

2/ when accessing Zabbix frontend as Zabbix Super Admin user, host's screens with prototyped graph always works.

3/ a test, Following Andrei's informations :
If I add the hostgroup *Templates* as read only in a UserGroup attached to a user with Zabbix admin or Zabbix user access , host's screens with prototyped graphs looks fine !

So it working because hostgroup *Templates* have template's screens with LLD graph)

So it can be a too restricted grant check only in the file host_screen.php.

It's a critical GUI bug because standard user can't show correctly those screen

Regards.

Comment by Kim Jongkwon [ 2016 Jul 05 ]

Still got a same problem with Zabbix 3.0.3.

I checked debug on hostscreen page with hostgroup read-only in a usergroup attached users (frontend).
This case, some 'itemprototype.get' do not return a value.

3. itemprototype.get [CScreenLldSimpleGraph.php:153]
Parameters:
Array
(
    [output] => Array
        (
            [0] => key_
        )

    [itemids] => Array
        (
            [0] => 23714
        )
)
Result:
Array
(
)
Comment by Gunars Pujats (Inactive) [ 2016 Jul 15 ]

(1) No translation strings changed.

iivs CLOSED

Comment by Gunars Pujats (Inactive) [ 2016 Jul 15 ]

RESOLVED in development branch svn://svn.zabbix.com/branches/dev/ZBX-9926

Comment by Natalja Romancaka [ 2016 Sep 12 ]

UI successfully tested

Comment by Ivo Kurzemnieks [ 2016 Oct 31 ]

(2) Dynamic elements are no longer working.

gunarspujats RESOLVED in r63476

iivs

if (($this->screenitem['dynamic'] == SCREEN_DYNAMIC_ITEM || $this->isTemplatedScreen) && $this->hostid) {
	$currentItemPrototype = API::ItemPrototype()->get([
		'output' => ['key_'],
		'itemids' => [$this->screenitem['resourceid']]
	]);
	$currentItemPrototype = reset($currentItemPrototype);

	$options['hostids'] = [$this->hostid];
	$options['filter'] = ['key_' => $currentItemPrototype['key_']];
}
// otherwise just use resource ID given to to this screen item.
else {
	$options['itemids'] = [$this->screenitem['resourceid']];
}

$options = zbx_array_merge($defaultOptions, $options);

It might be that there is just too much code here. The first get() and the second get() return the same thing for templated objects.

REOPENED

gunarspujats RESOLVED in r63511

iivs CLOSED

Comment by Ivo Kurzemnieks [ 2016 Nov 08 ]

TESTED

Comment by Gunars Pujats (Inactive) [ 2016 Nov 08 ]

Fixed in:

  • pre-3.0.6rc1 r63593
  • pre-3.2.2rc1 r63594
  • pre-3.3.0 r63595
Generated at Tue Mar 19 12:54:51 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.