Bug 1600116 - Audits taxonomies are being set from current context for non-taxable resources
Summary: Audits taxonomies are being set from current context for non-taxable resources
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Audit Log
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.4.0
Assignee: Sebastian Gräßl
QA Contact: Roman Plevka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-11 13:06 UTC by Roman Plevka
Modified: 2019-11-05 23:28 UTC (History)
4 users (show)

Fixed In Version: foreman-1.18.0.26-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-16 19:00:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 24234 0 None None None 2018-07-12 06:33:39 UTC

Description Roman Plevka 2018-07-11 13:06:56 UTC
Description of problem:
the taxonomies are being set even for resources that do not use them.
e.g. Architectures

Version-Release number of selected component (if applicable):
6.4.0-11

Steps to Reproduce:
1. 
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Marek Hulan 2018-07-12 06:32:55 UTC
Steps to reproduce:

1. switch context so you're in org1 and loc1
2. create architecture
3. go to audits page, you should see the audit
4. switch to org2, you should still see the audit because architecture is non-taxable, the audit lives only in org1

Devs notes:

The problem is that since Audit is now taxable, when we do Audit.new its org and loc defaults to current context. This is caused by after_initialize :set_current_taxonomy defined in Taxonomix

To see the behavior in console do:

Organization.current = org1
Audit.new.organization_ids # => you'll get org1.id

We override the value for taxable resources, but for non-taxable, such as architecture, this is a problem. We should override :set_current_taxonomy method in audite extensions to become noop.

Comment 2 Marek Hulan 2018-07-12 06:33:37 UTC
Created redmine issue https://projects.theforeman.org/issues/24234 from this bug

Comment 6 Roman Plevka 2018-09-19 11:12:30 UTC
VERIFIED
on sat6.4.0-22

this is now behaving correctly (no taxonomy is assigned to non-taxable items).

Comment 7 Bryan Kearney 2018-10-16 19:00:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:2927


Note You need to log in before you can comment on or make changes to this bug.