diff --git a/app/controllers/live_links_controller.rb b/app/controllers/live_links_controller.rb index f4b49d4aa..fe2de4afe 100644 --- a/app/controllers/live_links_controller.rb +++ b/app/controllers/live_links_controller.rb @@ -2,7 +2,8 @@ class LiveLinksController < ApplicationController before_action :require_login before_action :find_course, only: [:index, :create] before_action :user_course_identity, :teacher_allowed, only: [:create] - before_action :edit_auth, only: [:edit, :update, :destroy] + before_action :edit_auth, only: [:edit, :update] + before_action :delete_auth, only: [:destroy] def index lives = @course.live_links @@ -58,6 +59,10 @@ class LiveLinksController < ApplicationController end def edit_auth + tip_exception(403, "无权限操作") unless current_user.id == current_live.user_id || current_user.admin_or_business? + end + + def delete_auth tip_exception(403, "无权限操作") unless current_user.id == current_live.user_id || current_user.admin? end end \ No newline at end of file