video feature add teacher check

dev_winse
p31729568 6 years ago
parent 6d5571aff6
commit 32bb3c6044

@ -26,6 +26,12 @@ class Users::BaseController < ApplicationController
render_forbidden
end
def require_auth_teacher!
return if user.admin_or_business? || observed_user.certification_teacher?
render_forbidden
end
def page_value
params[:page].to_i <= 0 ? 1 : params[:page].to_i
end

@ -1,5 +1,5 @@
class Users::VideoAuthsController < Users::BaseController
before_action :private_user_resources!
before_action :private_user_resources!, :require_auth_teacher!
def create
result = Videos::CreateAuthService.call(observed_user, create_params)

@ -1,5 +1,5 @@
class Users::VideosController < Users::BaseController
before_action :private_user_resources!
before_action :private_user_resources!, :require_auth_teacher!
helper_method :current_video

Loading…
Cancel
Save