do not allow use of recently used dashboard without permission
This commit is contained in:
parent
8997af7170
commit
1ed492f35f
@ -71,7 +71,7 @@ class Dashboard < ActiveRecord::Base
|
|||||||
scope = where(dashboard_type: dashboard_type)
|
scope = where(dashboard_type: dashboard_type)
|
||||||
scope = scope.where(project_id: project.id).or(scope.where(project_id: nil)) if project.present?
|
scope = scope.where(project_id: project.id).or(scope.where(project_id: nil)) if project.present?
|
||||||
|
|
||||||
dashboard = scope.find_by(id: recently_id) if recently_id.present?
|
dashboard = scope.visible.find_by(id: recently_id) if recently_id.present?
|
||||||
|
|
||||||
if dashboard.blank?
|
if dashboard.blank?
|
||||||
scope = scope.where(system_default: true).or(scope.where(author_id: user.id))
|
scope = scope.where(system_default: true).or(scope.where(author_id: user.id))
|
||||||
|
@ -31,7 +31,7 @@ module Additionals
|
|||||||
return render_404
|
return render_404
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@dashboard = Dashboard.default(DashboardContentWelcome::TYPE_NAME)
|
@dashboard = Dashboard.default DashboardContentWelcome::TYPE_NAME
|
||||||
end
|
end
|
||||||
|
|
||||||
resently_used_dashboard_save @dashboard
|
resently_used_dashboard_save @dashboard
|
||||||
|
Loading…
x
Reference in New Issue
Block a user