Skip to content

Commit

Permalink
Merge pull request #138 from calblueprint/divi/fix-studio-assessments
Browse files Browse the repository at this point in the history
fixed auth for studio assessments
  • Loading branch information
didvi authored May 7, 2020
2 parents 80903f8 + 5f17d15 commit 2a36ed5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/studio_assessments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class StudioAssessmentsController < ApplicationController
# GET /studio_assessments
# GET /studio_assessments.json
def index
skip_policy_scope
@studio_assessments = authorize StudioAssessment.all
@studio_list = []
@studio_assessments.each do |s|
Expand Down
6 changes: 5 additions & 1 deletion app/policies/studio_assessment_policy.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
class StudioAssessmentPolicy < ApplicationPolicy
def index?
staff?
end

def create?
staff?
end
Expand All @@ -24,7 +28,7 @@ def resolve
if user.staff?
scope.all
else
scope.where([participant_id: user.participant.id])
scope.where(participant_id: user.participant.id)
end
end
end
Expand Down

0 comments on commit 2a36ed5

Please sign in to comment.