新建实训课程的权限控制

dev_forum
cxt 5 years ago
parent b63d94df24
commit 4e33c98190

@ -1,7 +1,7 @@
class SubjectsController < ApplicationController class SubjectsController < ApplicationController
before_action :require_login, :check_auth, except: [:index] before_action :require_login, :check_auth, except: [:index]
# before_action :check_auth, except: [:index] # before_action :check_auth, except: [:index]
before_action :find_subject, except: [:index, :create, :append_to_stage] before_action :find_subject, except: [:index, :create, :new, :append_to_stage]
before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish, before_action :allowed, only: [:update, :edit, :destroy, :publish, :cancel_publish, :cancel_has_publish,
:search_members, :add_subject_members, :statistics, :shixun_report, :school_report, :search_members, :add_subject_members, :statistics, :shixun_report, :school_report,
:up_member_position, :down_member_position] :up_member_position, :down_member_position]
@ -94,6 +94,10 @@ class SubjectsController < ApplicationController
@subject.increment!(:visits) @subject.increment!(:visits)
end end
def new
normal_status("")
end
def create def create
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin begin

Loading…
Cancel
Save