mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
adding more authentication, fixing category bug
This commit is contained in:
parent
60a2982724
commit
42fd3edbae
10 changed files with 28 additions and 93 deletions
|
|
@ -1,4 +1,6 @@
|
|||
class QuestionsController < ApplicationController
|
||||
before_action :authenticate_user!, except: [:show]
|
||||
before_action :verify_super_admin, except: [:show]
|
||||
before_action :set_school, only: [:show]
|
||||
before_action :set_question, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
|
|
@ -78,4 +80,8 @@ class QuestionsController < ApplicationController
|
|||
def question_params
|
||||
params.require(:question).permit(:text, :option1, :option2, :option3, :option4, :option5, :category_id)
|
||||
end
|
||||
|
||||
def verify_super_admin
|
||||
user_signed_in? && current_user.super_admin?
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue