From 76cd81ec8e20a82cfa9ea0d4e065c58d20e63663 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 28 Sep 2017 11:11:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=8D=E5=88=B6=E6=9D=83=E9=99=90=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 ++++ app/views/shixuns/_shixun_top.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 3dd01f27c..be7308a49 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -546,6 +546,10 @@ class ShixunsController < ApplicationController end def copy + unless (@shixun.can_copy && User.current.user_extensions.try(:identity) == 1 && User.current.professional_certification) + render_403 + return + end ActiveRecord::Base.transaction do begin new_shixun = Shixun.new diff --git a/app/views/shixuns/_shixun_top.html.erb b/app/views/shixuns/_shixun_top.html.erb index 1c8c75159..9c7b2384b 100644 --- a/app/views/shixuns/_shixun_top.html.erb +++ b/app/views/shixuns/_shixun_top.html.erb @@ -35,7 +35,7 @@ <% end %> 已关闭 <% end %> - <% if @shixun.can_copy %> + <% if @shixun.can_copy && User.current.user_extensions.try(:identity) == 1 && User.current.professional_certification %> <%#= link_to "复制", copy_shixun_path(@shixun), :class => "fr shixun-task-btn task-btn-green mr15" %> 复制 <% end %>