feat: Add authorization checks to admin and player actions
This commit is contained in:
@@ -16,6 +16,14 @@ module EuchreCamp
|
||||
def handle(request, response)
|
||||
tournament_id = request.params[:id]
|
||||
tournament = events_repo.by_id(tournament_id)
|
||||
user = current_user(request)
|
||||
|
||||
# Check authorization - tournament admin can manage their tournaments
|
||||
unless user && EuchreCamp::Services::Authorization.can?(user, :manage_tournament, tournament)
|
||||
response.flash[:error] = 'Access denied'
|
||||
response.redirect_to '/rankings'
|
||||
return
|
||||
end
|
||||
|
||||
# Get all registered participants for this tournament
|
||||
participants = participants_repo.by_event(tournament_id)
|
||||
|
||||
Reference in New Issue
Block a user