Project

General

Profile

« Previous | Next » 

Revision acfbc458

Added by Marek Hulán about 10 years ago

fixes #812 - new permissions model, user group role and nest support, role filters for better granularity

Contributions from:

View differences:

app/models/fact_value.rb
class FactValue < ActiveRecord::Base
include Authorizable
belongs_to_host
belongs_to :fact_name
......
}
scope :my_facts, lambda {
unless User.current.admin? and Organization.current.nil? and Location.current.nil?
#TODO: Remove pluck after upgrade to newer rails as it would be
#done via INNER select automatically
where(:fact_values => {:host_id => Host.my_hosts.pluck(:id)})
host_ids = Host.authorized(:view_hosts, Host).select('hosts.id').all
where(:fact_values => {:host_id => host_ids})
end
}

Also available in: Unified diff