Skip to content

Commit

Permalink
fix attachment deletion issue on articles due to failed permissions c…
Browse files Browse the repository at this point in the history
…heck

refs #244, thanks to @Luckyvb for the patch
  • Loading branch information
alexbevi committed Jul 24, 2014
1 parent 9a26813 commit 7c28cd0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/models/kb_article.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ def recipients
notified.uniq!
notified.collect(&:mail)
end

def editable_by?(user)
user.allowed_to?(:edit_articles, self.project)
end

def attachments_deletable?(user = User.current)
editable_by?(user) || super(user)
end

def new_status
if self.updater_id == 0
Expand Down

0 comments on commit 7c28cd0

Please sign in to comment.