Allow admins and moderators to delete traces

Fixes #1625
This commit is contained in:
biswesh456 2018-02-24 20:36:12 +05:30
parent c32a63058c
commit 646dcb62fc
3 changed files with 16 additions and 4 deletions

View file

@ -186,7 +186,7 @@ class TraceController < ApplicationController
if !trace.visible?
head :not_found
elsif current_user.nil? || trace.user != current_user
elsif current_user.nil? || (trace.user != current_user && !current_user.administrator? && !current_user.moderator?)
head :forbidden
else
trace.visible = false