Revision 5ddb3741
Added by Marek Hulán about 9 years ago
app/models/report.rb | ||
---|---|---|
|
||
# returns reports for hosts in the User's filter set
|
||
scope :my_reports, lambda {
|
||
unless User.current.admin? and Organization.current.nil? and Location.current.nil?
|
||
if !User.current.admin? || Organization.expand(Organization.current).present? || Location.expand(Location.current).present?
|
||
where(:reports => {:host_id => Host.authorized(:view_hosts, Host)})
|
||
end
|
||
}
|
Also available in: Unified diff
Fixes #9947 - restrict user taxonomies if none is set
(cherry picked from commit abe910f2a46f4ecc1f349263d0b4751ed46ff200)