复制权限修改

This commit is contained in:
huang 2017-09-28 11:11:15 +08:00
parent 3ec5a7991f
commit 76cd81ec8e
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -35,7 +35,7 @@
<% end %>
<a href="javascript:void(0);" class="fr shixun-task-ban-btn mr15">已关闭</a>
<% 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" %>
<a href="javascript:void(0);" onclick="op_confirm_box_loading('<%= copy_shixun_path(@shixun) %>', '复制将在后台执行</br>平台将为你创建一个新的同名实训和内容,请问是否继续?');" class = "fr shixun-task-btn task-btn-green mr15">复制</a>
<% end %>