2022-01-15 16:04:47 -08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-08-01 02:23:47 -07:00
|
|
|
module ApplicationHelper
|
2021-08-06 13:20:55 -07:00
|
|
|
include ApplicationHelper::GraphMethods
|
2022-01-10 13:14:58 -08:00
|
|
|
include ApplicationHelper::TitleMethods
|
2014-11-10 14:46:51 -08:00
|
|
|
|
2014-11-28 10:23:54 -08:00
|
|
|
def privileged?(user)
|
2022-01-15 16:04:47 -08:00
|
|
|
!current_user.nil? && ((current_user == user) || current_user.mod?)
|
2014-11-27 02:50:10 -08:00
|
|
|
end
|
2014-11-30 05:31:38 -08:00
|
|
|
|
2021-08-06 04:38:24 -07:00
|
|
|
def rails_admin_path_for_resource(resource)
|
2022-01-15 16:04:47 -08:00
|
|
|
[rails_admin_path, resource.model_name.param_key, resource.id].join("/")
|
2021-08-06 04:38:24 -07:00
|
|
|
end
|
2014-08-01 02:23:47 -07:00
|
|
|
end
|