mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-05 06:07:20 +00:00
School delegates permissions are working
This commit is contained in:
@@ -92,13 +92,16 @@ class WrestlersController < ApplicationController
|
||||
def check_access
|
||||
if params[:school]
|
||||
@school = School.find(params[:school])
|
||||
@tournament = Tournament.find(@school.tournament.id)
|
||||
#@tournament = Tournament.find(@school.tournament.id)
|
||||
elsif params[:wrestler]
|
||||
@school = School.find(params[:wrestler]["school_id"])
|
||||
@tournament = Tournament.find(@school.tournament.id)
|
||||
#@tournament = Tournament.find(@school.tournament.id)
|
||||
elsif @wrestler
|
||||
@tournament = @wrestler.tournament
|
||||
@school = @wrestler.school
|
||||
#@tournament = @wrestler.tournament
|
||||
elsif wrestler_params
|
||||
@school = School.find(wrestler_params[:school_id])
|
||||
end
|
||||
authorize! :manage, @tournament
|
||||
authorize! :manage, @school
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user