Skip to content

Commit 7c28cd0

Browse files
committed
fix attachment deletion issue on articles due to failed permissions check
refs #244, thanks to @Luckyvb for the patch
1 parent 9a26813 commit 7c28cd0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/models/kb_article.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ def recipients
5555
notified.uniq!
5656
notified.collect(&:mail)
5757
end
58+
59+
def editable_by?(user)
60+
user.allowed_to?(:edit_articles, self.project)
61+
end
62+
63+
def attachments_deletable?(user = User.current)
64+
editable_by?(user) || super(user)
65+
end
5866

5967
def new_status
6068
if self.updater_id == 0

0 commit comments

Comments
 (0)