Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HostGroup edit fails when director/filter/hostgroups is active #2164

Closed
okrouhly opened this issue Jul 22, 2020 · 1 comment
Closed

HostGroup edit fails when director/filter/hostgroups is active #2164

okrouhly opened this issue Jul 22, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@okrouhly
Copy link

okrouhly commented Jul 22, 2020

Expected Behavior

Work as normal editation (at least allow Assign where changes) of given Group to users that has allowed that group by director/filter/hostgroup setting.
Solving that issue may be a partial workarround to issue #2163

Current Behavior

An error occures when trying to edit given Host Group:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'o.object_name' in 'where clause', query was: SELECT h.id FROM icinga_hostgroup AS h WHERE (id = '4') AND (o.object_name IN ('Linux'))

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'o.object_name' in 'where clause'

Possible Solution

Change function filterHostGroupsQuery default argument to $tableAlias = 'h' instead of current value 'o' at file library/Director/Restriction/HostgroupRestriction.php

Steps to Reproduce (for bugs)

  • Limit user role to access only some Host Groups in Icinga Director by setting director/filter/hostgroups to correct value/name(s) of existing Host Group(s).
  • Logout/Login with that role.
  • Try to edit given Host Group with that user, an error above will be displayed.

Your Environment

  • Director version (System - About): 1.7.2 or older (tested also on 1.6.2)
  • Icinga Web 2 version and modules (System - About): N/A
  • Icinga 2 version (icinga2 --version): N/A
  • Operating System and version: N/A
  • Webserver, PHP versions: N/A
@formorer
Copy link

formorer commented Feb 8, 2021

I am also facing that Problem with a recent Director and the simple fix also fixes it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants