Fixed ACL check for deleting screenshots

This commit is contained in:
Christoph Haas 2017-08-17 19:00:35 +02:00
parent 02d96bd6b7
commit 317e583b97

View file

@ -104,7 +104,7 @@ class PackagesController < ApplicationController
# Check if the user is allowed to change this screenshot
# - Is this the user's own screenshot? (anonymous)
if self.user = current_user or current_user.is_admin?
if @screenshot.user == current_user or current_user.is_admin?
logger.debug "User #{current_user} deletes screenshot #{@screenshot}"
@screenshot.destroy
flash['notice'] = "Screenshot deleted."