Fixed ACL check for deleting screenshots
This commit is contained in:
parent
02d96bd6b7
commit
317e583b97
1 changed files with 1 additions and 1 deletions
|
|
@ -104,7 +104,7 @@ class PackagesController < ApplicationController
|
||||||
|
|
||||||
# Check if the user is allowed to change this screenshot
|
# Check if the user is allowed to change this screenshot
|
||||||
# - Is this the user's own screenshot? (anonymous)
|
# - 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}"
|
logger.debug "User #{current_user} deletes screenshot #{@screenshot}"
|
||||||
@screenshot.destroy
|
@screenshot.destroy
|
||||||
flash['notice'] = "Screenshot deleted."
|
flash['notice'] = "Screenshot deleted."
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue