Admin should be owner of procedure to destroy it

This commit is contained in:
Mathieu Magnin 2017-07-20 14:30:36 +02:00
parent 409bed4080
commit e468612d95
2 changed files with 12 additions and 4 deletions

View file

@ -51,7 +51,7 @@ class Admin::ProceduresController < AdminController
end
def destroy
procedure = Procedure.find(params[:id])
procedure = current_administrateur.procedures.find(params[:id])
return render json: {}, status: 401 if procedure.publiee_ou_archivee?