Project

General

Custom queries

Profile

Actions

Bug #28093

closed

Wrong host ownership in UserMailNotifications

Added by Emil Dragu over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Notifications
Target version:
-
Fixed in Releases:
Found in Releases:

Description

This behavior was detected as a result of incorrect hosts in host_mailer("Configuration Management Summary Report") mail notification.

Steps to reproduce.
1. Must have a usergroup and a user that is part of this group but is not administrator.
2. Set owner of a host to the above usergroup.
3. Run the following with foreman-rake console(I assume the same happens in mail notification tasks):
usr = User.find_by(login: 'testuser')
usr.hosts #correctly returns all the hosts the user owns and thus is authorized to view
Host::Managed.authorized_as(usr, :view_hosts, Host) # this should include the host owned by the groups user is part of, but is not. Scoped search seems to be executed based on current user which is foreman_console_admin in this case.

#6

Updated by The Foreman Bot over 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/7422 added
#7

Updated by The Foreman Bot about 5 years ago

  • Fixed in Releases 2.1.0 added
#8

Updated by The Foreman Bot about 5 years ago

  • Assignee set to Tomer Brisker
  • Pull request https://github.com/theforeman/foreman/pull/7543 added
#9

Updated by Anonymous about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF