直播权限调整

pay_subject
cxt 5 years ago
parent 19ba6f6a56
commit e48282e29b

@ -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
Loading…
Cancel
Save