|
|
|
@ -41,10 +41,6 @@ class Users::ShixunService
|
|
|
|
|
|
|
|
|
|
def user_policy_filter(relations)
|
|
|
|
|
# 只有自己或者管理员才有过滤筛选及查看全部状态下实训功能
|
|
|
|
|
Rails.logger.info("self_or_admin?: #{self_or_admin?}")
|
|
|
|
|
Rails.logger.info("user: #{user.id}")
|
|
|
|
|
Rails.logger.info("User.current.id : #{User.current.id }")
|
|
|
|
|
Rails.logger.info("relations : #{relations.map(&:id) }")
|
|
|
|
|
if self_or_admin?
|
|
|
|
|
relations = relations.where.not(status: -1)
|
|
|
|
|
status_filter(relations)
|
|
|
|
@ -73,8 +69,6 @@ class Users::ShixunService
|
|
|
|
|
when 'published' then 2
|
|
|
|
|
when 'closed' then 3
|
|
|
|
|
end
|
|
|
|
|
Rails.logger.info("######status: #{status}")
|
|
|
|
|
Rails.logger.info("######relations: #{relations.map(&:id)}")
|
|
|
|
|
relations = relations.where(status: status) if status
|
|
|
|
|
relations
|
|
|
|
|
end
|
|
|
|
|