Commit c6d2290b authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻 Committed by Kaspar
Browse files

implement kitsane review feedback

parent ae5e7308
......@@ -5,7 +5,6 @@ class AssignmentsController < ApplicationController
def index
authorize Assignment
# @assignments = AssignmentPolicy::Scope.new(current_user, Assignment).resolve_all_to_superadmin
@assignments = policy_scope(Assignment)
end
......
......@@ -18,8 +18,8 @@ class VolunteerEmailsController < ApplicationController
def create
@volunteer_email = VolunteerEmail.new(volunteer_email_params)
authorize @volunteer_email
@volunteer_email.user = current_user
authorize @volunteer_email
if @volunteer_email.save
redirect_to @volunteer_email,
notice: t('crud.created', model: @volunteer_email.class.model_name.human)
......
......@@ -23,8 +23,8 @@ class VolunteersController < ApplicationController
def create
@volunteer = Volunteer.new(volunteer_params)
authorize @volunteer
@volunteer.registrar = current_user
authorize @volunteer
if @volunteer.save
redirect_to @volunteer, notice: t('volunteer_created')
else
......
......@@ -17,10 +17,6 @@ class ApplicationScope
scope.where(user: user)
end
def all_to_superadmin
all if superadmin?
end
def superadmin_or_owner
return all if superadmin?
resolve_owner
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment