Fix authorization for communitySolutionsIndex

This commit is contained in:
Sebastian Serth
2022-08-18 16:28:10 +02:00
parent 7da47a7b5c
commit 3248bd74d1
2 changed files with 14 additions and 17 deletions

View File

@@ -11,7 +11,7 @@ class CommunitySolutionsController < ApplicationController
# GET /community_solutions
def index
@community_solutions = CommunitySolution.all
@community_solutions = CommunitySolution.all.paginate(page: params[:page], per_page: per_page_param)
authorize!
end
@@ -85,7 +85,7 @@ class CommunitySolutionsController < ApplicationController
private
def authorize!
authorize(@community_solution)
authorize(@community_solution || @community_solutions)
end
# Use callbacks to share common setup or constraints between actions.