Fix new users being able to remove posts from pools

This commit is contained in:
Toks
2015-10-22 22:25:02 -04:00
parent b708f5ea03
commit 40800988a8
2 changed files with 13 additions and 0 deletions

View File

@@ -916,6 +916,7 @@ class Post < ActiveRecord::Base
def remove_pool!(pool, force = false)
return unless belongs_to_pool?(pool)
return unless CurrentUser.user.can_remove_from_pools?
return if pool.is_deleted? && !force
reload
self.pool_string = pool_string.gsub(/(?:\A| )pool:#{pool.id}(?:\Z| )/, " ").strip