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/controllers/api/v1/reports_controller.rb
param :per_page, String, :desc => "number of entries per request"
def index
@reports = Report.my_reports.includes(:logs => [:source, :message]).
@reports = Report.
authorized(:view_reports).
my_reports.
includes(:logs => [:source, :message]).
search_for(*search_options).paginate(paginate_options)
end
......
def last
conditions = { :host_id => Host.find_by_name(params[:host_id]).try(:id) } unless params[:host_id].blank?
max_id = Report.my_reports.where(conditions).maximum(:id)
@report = Report.includes(:logs => [:message, :source]).find(max_id)
max_id = Report.authorized(:view_reports).my_reports.where(conditions).maximum(:id)
@report = Report.authorized(:view_reports).includes(:logs => [:message, :source]).find(max_id)
render :show
end

Also available in: Unified diff