Skip to content

Commit

Permalink
Dont let users comment on news before their publication
Browse files Browse the repository at this point in the history
  • Loading branch information
nono committed Jun 16, 2011
1 parent 874913f commit 6c05781
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/news.rb
Expand Up @@ -234,6 +234,10 @@ def destroyable_by?(account)
account && (account.moderator? || account.admin?)
end

def commentable_by?(account)
super(account) && published?
end

def acceptable_by?(account)
account && (account.admin? || (account.moderator? && acceptable?))
end
Expand Down

0 comments on commit 6c05781

Please sign in to comment.